Hi,
I come across out of memory expetion in my application.I'm not using large amount of data.
Scenario:
I have application that need to print draw for martial art fights. There are over 100 categories and each category is on 1 page (up to 32 players) and on more then 1 if there are more then 32 players in category. Each category has its own report. Report is basicly manualy drawn draw (textboxes and lines). For example for 32 players draw I have 160 texboxes and each ot them has 2 or 3 conditinal formating and 2 of those conditional formating is also using backgroung image (images are taken from global::resource and not from report). When I render each report one by one everthing is fine. Problem comes when I need to create PDF with all drawns in it (100+pages).
I use ReportBook and in foreach statement I'm adding report to ReportBook. After that foreach statement I have this code but application does not come to that part.
Is there any way that I actualy render 1 report at time and then just glue them in 1 PDF (like I create 100+ individual reports and then save them all in 1 PDF).
When I watch for memory, this PDF creating takes from 200MB memory up to 2,6 GB and then gives me "parameter is null" error on screen but when I debug application details says "out of memory". There is still more phisical memory free on server. I dont know what is taeking 2,6 GB of memory and final result is 300 kb PDF.
Please help.
I come across out of memory expetion in my application.I'm not using large amount of data.
Scenario:
I have application that need to print draw for martial art fights. There are over 100 categories and each category is on 1 page (up to 32 players) and on more then 1 if there are more then 32 players in category. Each category has its own report. Report is basicly manualy drawn draw (textboxes and lines). For example for 32 players draw I have 160 texboxes and each ot them has 2 or 3 conditinal formating and 2 of those conditional formating is also using backgroung image (images are taken from global::resource and not from report). When I render each report one by one everthing is fine. Problem comes when I need to create PDF with all drawns in it (100+pages).
I use ReportBook and in foreach statement I'm adding report to ReportBook. After that foreach statement I have this code but application does not come to that part.
ReportProcessor reportProcessor =
new
ReportProcessor( );
Telerik.Reporting.InstanceReportSource instanceReportSource =
new
Telerik.Reporting.InstanceReportSource( );
var reportToExport = reportBook;
instanceReportSource.ReportDocument =reportToExport;
RenderingResult result = reportProcessor.RenderReport(
"PDF"
, instanceReportSource,
null
);
string
fileName = result.DocumentName +
"."
+ result.Extension;
Response.Clear( );
Response.ContentType = result.MimeType;
Response.Cache.SetCacheability( HttpCacheability.Private );
Response.Expires = -1;
Response.Buffer =
true
;
Response.AddHeader(
"Content-Disposition"
,
string
.Format(
"{0};FileName=\"{1}\""
,
"attachment"
, fileName ) );
Response.BinaryWrite( result.DocumentBytes );
Response.End( );
Is there any way that I actualy render 1 report at time and then just glue them in 1 PDF (like I create 100+ individual reports and then save them all in 1 PDF).
When I watch for memory, this PDF creating takes from 200MB memory up to 2,6 GB and then gives me "parameter is null" error on screen but when I debug application details says "out of memory". There is still more phisical memory free on server. I dont know what is taeking 2,6 GB of memory and final result is 300 kb PDF.
Please help.