File zip with more reports

Stimulsoft Reports.NET discussion
Post Reply
MarcoGecoit
Posts: 17
Joined: Tue Apr 12, 2011 8:22 am

File zip with more reports

Post by MarcoGecoit »

Good evening
I need to create a zip file with multiple reports, they are saved as individual files.
How can I do to attach these files?
Thanks
Marco
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

File zip with more reports

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
MarcoGecoit
Posts: 17
Joined: Tue Apr 12, 2011 8:22 am

File zip with more reports

Post by MarcoGecoit »

Hi,
I've an application web and many reports (all_1.mrt, all_2.mrt, ecc...)
I need to print all togheter, in a single zip file (not a many pdf)
Is it possibile to append many reports in StiReport object? IF yes, is it possible to save in zip format?
Thank you
Marco
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

File zip with more reports

Post by Alex K. »

Hello,

Please let us know do you want to merge all of your reports into one report and then export it into a one PDF file?

Thank you.
MarcoGecoit
Posts: 17
Joined: Tue Apr 12, 2011 8:22 am

File zip with more reports

Post by MarcoGecoit »

Hello,
Because these files can be printed individually in different parts of the web application, only at a certain point I need to print them all together by pressing a button.
The objective is to get in Response to a single file.
I wondered if I can combine all these files into a single StiReport object, or create as many pdf to merge with a zip library of third property.
Thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

File zip with more reports

Post by Alex K. »

Hello,

Please see the sample code how to megre two report in one:

Code: Select all

StiReport report1 = new StiReport();
report1.Load("e:\\Report1.mrt");
report1.Render(false);

StiReport report2 = new StiReport();
report2.Load("e:\\Report2.mrt");
report2.Render(false);

StiReport reportAll = new StiReport();
reportAll.Render();
reportAll.RenderedPages.Clear();

foreach (StiPage page in report1.RenderedPages)
{
    reportAll.RenderedPages.Add(page);
}

foreach (StiPage page in report2.RenderedPages)
{
    reportAll.RenderedPages.Add(page);
}
reportAll.Show();
Thank you.
MarcoGecoit
Posts: 17
Joined: Tue Apr 12, 2011 8:22 am

File zip with more reports

Post by MarcoGecoit »

Perfect, it works fine!
Thank you
Marco
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

File zip with more reports

Post by Andrew »

Great! :biggrin:

Have a nice day!
Thank you.
Post Reply