How can i load partial data in a report viewer control?

Stimulsoft Reports.Silverlight discussion
Locked
gustavo
Posts: 16
Joined: Fri Jan 06, 2012 11:23 am

How can i load partial data in a report viewer control?

Post by gustavo »

I made my report using a SQL database connection...
but i'm getting an error about OutOfMemoryException when rendering it, because my table has about 50.000 lines.

Question 1: How can i make to StiSLViewerControl load data as needed?
exemple:
Show only the first page...
when it moves to the next page, then it makes a new connection to load the data

To avoid load all the 50.000 lines at same time... and I can't split my report to smaller ones.


Question 2: And when it request to export... then i'll need all the 50.000 lines data to be exported...

Is there a simple way to create this two solutions?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How can i load partial data in a report viewer control?

Post by HighAley »

Hello.
gustavo wrote:I made my report using a SQL database connection...
but i'm getting an error about OutOfMemoryException when rendering it, because my table has about 50.000 lines.

Question 1: How can i make to StiSLViewerControl load data as needed?
exemple:
Show only the first page...
when it moves to the next page, then it makes a new connection to load the data

To avoid load all the 50.000 lines at same time... and I can't split my report to smaller ones.


Question 2: And when it request to export... then i'll need all the 50.000 lines data to be exported...

Is there a simple way to create this two solutions?
Please, try to set the PageLoadingMode="OnePage" propery of StiWebViewerSL and StiWebDesignerSL then pages will be loaded as needed.

Thank you.
gustavo
Posts: 16
Joined: Fri Jan 06, 2012 11:23 am

How can i load partial data in a report viewer control?

Post by gustavo »

But i'm using this property...




but the problem is when it calls webservice method...
The LoadReport method... calls a helper RenderingReportHelper.CheckReportOnInteractions - (same as the sample project)
and it return a huge string... looks like it has all the pages at same time...
This is the code:


Public Function LoadReport(reportName As String) As String
If Not String.IsNullOrEmpty(reportName) Then
Dim report As New StiReport()
report.Load("Reports\" & reportName)
report.Render(False)

Dim r2 = RenderingReportHelper.CheckReportOnInteractions(report, True)
Return r2
End If
Return Nothing
End Function


And at the end, it calls:
viewer.ApplyRenderedReport(e.Result);

but before this las call, it throws an exception about OutOfMemoryException

what i'm doing wrong to make OnePage property works?
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

How can i load partial data in a report viewer control?

Post by Anton Lozovskiy »

Hello,

Can you please send us a sample application with data, which reproduce the issue?

Thank you.
gustavo
Posts: 16
Joined: Fri Jan 06, 2012 11:23 am

How can i load partial data in a report viewer control?

Post by gustavo »

it is the Stimulsoft.Reports.Samples.WCF... that i downloaded from this forum.
i just create a new report (4 columns from 1 table) and i tryed to render ir...

the query should return about 50.000 lines...
but it throws OutOFMemoryException

then i read something about use PageLoadingMode = "OnePage" property... but i don't know how to use it...
i put it in my code and nohting changed...

Do you have some sample project or code using PageLoadingMode and SQL Connections? or could you create a sample project and share it here? please!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How can i load partial data in a report viewer control?

Post by HighAley »

Hello.
gustavo wrote:it is the Stimulsoft.Reports.Samples.WCF... that i downloaded from this forum.
i just create a new report (4 columns from 1 table) and i tryed to render ir...

the query should return about 50.000 lines...
but it throws OutOFMemoryException

then i read something about use PageLoadingMode = "OnePage" property... but i don't know how to use it...
i put it in my code and nohting changed...

Do you have some sample project or code using PageLoadingMode and SQL Connections? or could you create a sample project and share it here? please!
The PageLoadingMode="OnePage" property doesn't work now. This problem is in our to-do list.
To help you with Out of Memory Exception we need to see your working project and analyse it.

Thank you.
gustavo
Posts: 16
Joined: Fri Jan 06, 2012 11:23 am

How can i load partial data in a report viewer control?

Post by gustavo »

Any ideia when this property will be avaliable in silverlight?

i'm getting this exception when i call a huge report... mode than 1200 pages... the memory goes to the limit...
because of this i wanted to implement one page mode.

the only method that i have is:

Code: Select all

In my service: 

    Public Function LoadReport(reportName As String) As String
        If Not String.IsNullOrEmpty(reportName) Then
            Dim report As New StiReport()
            report.Load(reportName)
            report.Render(False)
            Return RenderingReportHelper.CheckReportOnInteractions(report, True)   <-- Here it returns the huge result
        End If
        Return Nothing
    End Function

and then... it return to my ViewPage

Code: Select all

report.ApplyRenderedReport(e.result) <-- here it throws the exception


very simple code at the moment...
is there any workaround until be possible to load one page at time?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How can i load partial data in a report viewer control?

Post by Alex K. »

Hello,

Unfortunately, but on the current moment this cannot be implemented. You can use filtering or split it the report on several parts.

Thank you.
Locked