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]);
Code: Select all
repExp.NeedsCompiling = false;
repExp.IsRendered = true;
//Export a PDF, just for comparing purposes
repExp.ExportDocument(StiExportFormat.Pdf,"TestMerge.pdf");
repExp.Show();
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.