[SOLVED] Huge pages when joining rendered pages

Stimulsoft Reports.NET discussion
Post Reply
Feko
Posts: 4
Joined: Wed Apr 22, 2015 6:22 pm

[SOLVED] Huge pages when joining rendered pages

Post by Feko »

Hello!

Sorry in advice if this is an amateur question, I'm doing my first tests on Reports.Net.
I have a .mrt file, with a few variables (Very few, only 5 at this moment) and I can render and view it perfectly!
I would like to "clone" the page, so I can just change the variables and render a new one.
A quick search, brought me to this topic: http://forum.stimulsoft.com/viewtopic.php?f=13&t=38392 where and Admin said: "As a way you can render report once and save rendered pages. Than make changes and render report again. Copy rendered pages to the first one."
So, that's exactly what I'm going to do.

Code: Select all

//The main report
var repExp = new StiReport();
repExp.RenderedPages.Clear();

//A temp one.
var tempReport = new StiReport();
tempReport.Load(ReportSettings.FileName);
//... change a few variables
tempReport.Compile();
tempReport.Render();
//Export a PDF, just to check if it is ok
tempReport.ExportDocument(StiExportFormat.Pdf,"Test.pdf");
repExp.RenderedPages.Add(tempReport.RenderedPages[0]);


//... change a few variables
tempReport.RenderedPages.Clear();
tempReport.Compile();
tempReport.Render();
//Export a PDF, again
tempReport.ExportDocument(StiExportFormat.Pdf,"Test.pdf");
repExp.RenderedPages.Add(tempReport.RenderedPages[0]);


//... change a few variables
tempReport.RenderedPages.Clear();
tempReport.Compile();
tempReport.Render();
tempReport.ExportDocument(StiExportFormat.Pdf,"Test.pdf");
repExp.RenderedPages.Add(tempReport.RenderedPages[0]);
OK now... I have three PDF's at this moment. I want one PDF with three pages, so, I'll export the last one.

Code: Select all

repExp.NeedsCompiling = false;
repExp.IsRendered = true;
//Export a PDF, just for comparing purposes
repExp.ExportDocument(StiExportFormat.Pdf,"TestMerge.pdf");
repExp.Show();
I don't know what am I doing wrong, but the pages in final PDF are HUGE!! Even repExp.Show(); shows me a huge report.
But, all the three PDFs are in expected size, how could it possibly go wrong?

The PDFs are attached, the three exports and the final one.

Thanks in advice.
Attachments
PDFs.zip
(568.14 KiB) Downloaded 121 times
Last edited by Feko on Thu Apr 23, 2015 10:48 am, edited 1 time in total.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Huge pages when joining rendered pages

Post by Alex K. »

Hello,

Please check that both reports have the same Report Unit property.
Please try to set for the first report repExp Report Unit property the same as for the second.

Thank you.
Feko
Posts: 4
Joined: Wed Apr 22, 2015 6:22 pm

Re: Huge pages when joining rendered pages

Post by Feko »

Aleksey wrote: Please check that both reports have the same Report Unit property.
Wow, quick and precise!
Thanks a lot for your reply, that's exactly what was wrong.
Problem solved!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: [SOLVED] Huge pages when joining rendered pages

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
Post Reply