Generated large report : Out Of Memory Exception

Stimulsoft Reports.NET discussion
Post Reply
mosoul
Posts: 14
Joined: Fri Jan 25, 2013 9:26 am
Location: France

Generated large report : Out Of Memory Exception

Post by mosoul »

Hello,

I know this is another question about performance...
But i've read some Topic that's talk about that, and i think i used the right way, but i want to be sure :)

I've made report who load Data with Stored Procedure. I've export my report as .CS file, and create in my projet an Assembly who contains all of my report in .CS.

In server part (we used WCF), I export in pdf (to save in DataBase and return file on the client part) or savedocument (and return this to displayed in viewer on the client part) my report. I export very large report (more than 17000 pages), and user's pc are not powerfull (4Go RAM). I don't have any error with my development pc (16 Go RAM), and if i do smaller report (of course ;) ).
More over, i observed that i can generate more larger pdf export than a SaveDocument (for a viewer display).

So this is an example of what i do :

Code: Select all

MemoryStream myDocument = new MemoryStream();
//Instanciate my report
StiReport report = null;
report = new MyReport1();
OR
report = new MyReport2();
OR
report = new MyReport3();

//Change the connectionString
string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Name", "Name", connectionString, false));

//Add references assembly (Contains business object that contains parametrers for stored procedure)
List<string> assemblies = report.ReferencedAssemblies.ToList();
assemblies.Add(System.Reflection.Assembly.GetAssembly(typeof(MyTypeOfBusinessObject)).Location);
report.ReferencedAssemblies = assemblies.ToArray();

report.RegBusinessObject("Obj1", new GeneralsParameters() {...});
report.RegBusinessObject("Obj2", new SpecialParameters() { ...});

report.Render();

//in different case :
report.SaveDocument(myDocument);
OR
report.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, myDocument);

//Others code lines who persist generated files

return myDocument;
I've a way to optimize my generation ?

Best regards,
Morgan.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Generated large report : Out Of Memory Exception

Post by HighAley »

Hello.

We can't give you any advice based on this part of your code.
Usually it's better to optimize reports.
As a way you could read an article in our Knowledge Base.

Thank you.
mosoul
Posts: 14
Joined: Fri Jan 25, 2013 9:26 am
Location: France

Re: Generated large report : Out Of Memory Exception

Post by mosoul »

Hello,

Thanks for reply.
I've allready read this article...
So, I've to work on report optimization !

Best regards,
Morgan
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Generated large report : Out Of Memory Exception

Post by HighAley »

Hello, Morgan.

Let us know if you will need any additional help.

Thank you.
Post Reply