Report in report

Stimulsoft Reports.WEB discussion
Post Reply
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Report in report

Post by LeMinhChau »

hi everyone!
I have 2 file report mrt.
I user a header file for all the report so I do want to be drag in to the header for each report. how do it?

ex:
report1.mrt the report header
I want to use this report for report2.mrt header.

Thank you very much!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Report in report

Post by Alex K. »

Hello,

Please try to use the Sub-Report component with property UseExternalReport.

Thank you.
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Report in report

Post by LeMinhChau »

Hi Aleksey!
Please, can you get me an example it?

Thankyou very much!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Report in report

Post by Alex K. »

Hello,

You can add the Sub-Report in Header section in your reports, set the UseExternalReport property to true and use the following code for load SubReport:

Code: Select all

		.....
            StiReport rep = new StiReport();
            rep.LoadFromUrl(@"D:\MainReport.mrt");
            rep.GetSubReport += new StiGetSubReportEventHandler(rep_GetSubReport);
            rep.Render();
            rep.Show();
		.....
		

        void rep_GetSubReport(object sender, StiGetSubReportEventArgs e)
        {
            StiReport rep = new StiReport();
            rep.LoadFromUrl(@"D:\SubReport.mrt");
            e.Report = rep;
        }
Thank you.
Post Reply