Telerik Forums
Reporting Forum
4 answers
629 views
I am able to create PDF's from my Telerik report very easily, and it works great.  I want to save that report to the database, so it doesn't have to regenerate every time.  It is not saving for some reason to the database, and I know that I can do this with other PDF byte arrays in other pieces of my code.  Is something different with the Telerik Byte Array?  Both below save data with other PDF byte arrays, but not the telerik report.  What am I doing wrong?  When I debug, both have values in the byte array, reportBytes.

Example 1, VB does not work: (param1 is passed in as an integer)

            Dim reportBytes As Byte()
            Dim mimeType As String = String.Empty
            Dim ext As String = String.Empty
            Dim encoding As Encoding = encoding.Default
            reportBytes = Telerik.Reporting.Processing.ReportProcessor.Render("PDF", report, Nothing, mimeType, ext, encoding)

            asqlConnection = GF_GET_DATABASE_CONNECTION()
            Dim sql As String = "UPDATE TABLE SET PDF = @reportBytes where xxx=" & CType(param1, String)
            Dim cmd As SqlCommand = New SqlCommand(sql, asqlConnection)
            cmd.Parameters.AddWithValue("@reportBytes", reportBytes)
            Dim id As Integer = cmd.ExecuteNonQuery()

Example 2, C# does not work (param1 is passed in as an integer):
            byte[] reportBytes =ReportProcessor.Render("PDF", reportToExport, null,out mimeType, out ext, out encoding);
            Database db = DatabaseFactory.CreateDatabase("ConnectionString");
            DbCommand dbCommand = db.GetSqlStringCommand("update TABLE set PDF = @imageData where xxx=" + param1);

            db.AddInParameter(dbCommand, "@imageData", DbType.Binary, reportBytes);

            int ret = db.ExecuteNonQuery(dbCommand);
            dbCommand.Dispose();

Nasko
Telerik team
 answered on 29 Jul 2015
1 answer
170 views

I just updated my Telerik Reporting to 2015 Q2. I'm almost done fixing every obseletes properties and method but one issue remain and I can't find any proper solution to fix it. Here is my code:

Dim GridColumnElements() As Processing.ProcessingElement = GridTable.ChildElements.Find("GridColumnTextBox", True)
For i As Integer = 0 To GridColumnElements.Count - 1
     Dim ColumnRatio As Double = (GrdField.Columns(i).Width / TotalColumnPixelWidth)
     Dim ColumnWidth As Unit = TotalGridWidth.Multiply(ColumnRatio)
     Dim pe As Processing.ProcessingElement = GridColumnElements(i)
     Dim tb As Processing.TextBox = DirectCast(pe, Processing.TextBox)

 

Now I get the classic:

"Warning 'Public ReadOnly Property ChildElements As Telerik.Reporting.Processing.ProcessingElement.ElementCollection' is obsolete: 'The Telerik.Reporting.Processing.ProcessingElement.ChildElements property is now obsolete. Use Telerik.Reporting.Processing.ElementTreeHelper.GetChildElements() method instead.'

 

It doesn't seems to have any method that would suite me well in this case.. any ideas ?

Nasko
Telerik team
 answered on 29 Jul 2015
1 answer
167 views

Hi All,

 

Can we create report book with report designer only ? not using code

 

 

Nasko
Telerik team
 answered on 29 Jul 2015
4 answers
170 views

Hi All,

I'm getting a weird problem with page size/printable region with reports.

Started getting it in version Q3 2014 and upgraded to Q2 2015 and still getting it.

I designed a sample report real fast using the Band Report wizard to demonstrate the problem (see attached).

I design a report as Portrait Letter using the wizard, margins are 0 for Left and Right in the screenshot (tried .2in,...)  It appears that when the reports are rendered they are being scaled down or something.  See attached image and note the ruler at the top of the designer and the difference in the Viewer below it...

Its not occurring with any applications like Word/Excel or any other print operation.  Tried printing to Printer, XLS and PDF and its all the same.

Any ideas?  I've tried playing with margins, paper size,... In code I set the viewer to view the print layout and landscape=false and that's it.

:-s

Thanks

Stef
Telerik team
 answered on 28 Jul 2015
2 answers
122 views

Hi,

I have a telerik reporting WCF self host service to show the report with silverlight report viewer. I noticed that the WCF function fire twice when I run the report.

can anyone tell me the cause.

 

Thanks in advance

Chandan

Stef
Telerik team
 answered on 28 Jul 2015
3 answers
310 views
Hi,
I want to graphically show a simple project schedule on a report (i.e simple Gantt). I think the Range Bar graph may be suitable but can't get it to work and can't find any examples or documentation, is there anything available?
I want to list each job on the Y axis with dates on the X axis. with a Bar between start and end dates for each job.
Here is an example of the object data-source I'm using:
public class ProjectSchedule
{
    public ProjectSchedule() { }
    public string JobName { get; set; }
    public DateTime Start { get; set; }
    public DateTime End { get; set; }
    public static List<ProjectSchedule> GetSchedule()
    {
        return new List<ProjectSchedule>(){
            new ProjectSchedule(){ JobName="JOB1", Start=DateTime.Now.AddDays(5), End=DateTime.Now.AddDays(10)},
            new ProjectSchedule(){ JobName="JOB2", Start=DateTime.Now.AddDays(5), End=DateTime.Now.AddDays(15)},
            new ProjectSchedule(){ JobName="JOB3", Start=DateTime.Now.AddDays(3), End=DateTime.Now.AddDays(7)},
            new ProjectSchedule(){ JobName="JOB3", Start=DateTime.Now.AddDays(10), End=DateTime.Now.AddDays(18)}
        };
    }
}

Any help greatly appreciated.

Stef
Telerik team
 answered on 28 Jul 2015
8 answers
507 views
So the question is simple, though the set-up and and architecture may not be.

The simple point is, I have a report with drill down action using toggle, and the toggle button it produces that I can work with in the preview just fine. However, when I've exported the report and view it within the Report Viewer, the report renders will all the data just fine, but the toggle button is no longer there so that functionality is lost.

I'm using the web form report viewer control, my team is adamant on using this to avoid the external calls the newer version relies on to function. The report is provided by deserializing xml stored within the database. The webform has registered assemblies to the reportviewer.webforms and reporting namespaces.
Stef
Telerik team
 answered on 28 Jul 2015
3 answers
435 views

Hello, 

We are using Telerik Reporting in a WebApp that is open all day in a browser for the users as they do their work. The Reports are Ajax reloaded in the same report view on demand, but if the reporting is not touched for longer than an hour we get an exception from Telerik. If they refresh the page, it will work fine again, however they will loose the work they are doing. How can we hold a report view open for a longer period of time? 

 

{"message":"","exceptionMessage":"Client with ID '092435-2fa6' not found. Expired.","exceptionType":"Telerik.Reporting.Services.Engine.InvalidClientException","stackTrace":" at Telerik.Reporting.Services.Engine.ReportEngine.WithClient[T](String clientID, Func`2 func)\r\n at Telerik.Reporting.Services.WebApi.ReportsControllerBase.CreateInstance(String clientID, ClientReportSource reportSource)\

 

Is there is a Cache setting we need to change to improve this time out?

Thank you. 

Stef
Telerik team
 answered on 28 Jul 2015
1 answer
102 views

Hi all

I'm using silverlight report viewer I'm calling it with the WCF Service but the Service is calling class 4 times I have attached the screen shot of it . because of calling 4 Times the report is loading slowly how rectify it . and can we use the html 5 report viewer instead of silverlight report viewer?

Thanks 

Prashanth 

Stef
Telerik team
 answered on 27 Jul 2015
1 answer
178 views
Hi all,
i'm working on C# , Silverlight with MVVM concept , I'm using Silverlight Report viewer to print or print preview the reports .
this report viewer is calling by using the WCF services here my report is loading slowly I checked with fiddler and found that the service is calling calling  4 times here I have attached the image of that and piece of code how I implemented. I think ,because of calling 4 times the report is loading slowly .And here is a question can we use  HTML5 report viewer instead of Silverlight Report Viewer with C# , Silverlight with MVVM concept ? does this work fast compare to Silverlight report engine? if possible can any one  Please provide the demo project or link to refer.

Thanks
Victor     
Stef
Telerik team
 answered on 27 Jul 2015
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?