How to Concatinate two Report?
-
- Posts: 74
- Joined: Fri Dec 07, 2012 11:35 am
How to Concatinate two Report?
Hi,
I have more then one Reports and looking to display them with in the same UI dynamicly.
Thanks
I have more then one Reports and looking to display them with in the same UI dynamicly.
Thanks
Re: How to Concatinate two Report?
Hello.
If you need to join reports you could use next code:
If you need to join reports you could use next code:
Thank you.StiReport rep1 = new StiReport();
rep1.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report1.mrt");
rep1.Compile();
rep1.Render();
StiReport rep2 = new StiReport();
rep2.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report2.mrt");
rep2.Compile();
rep2.Render();
StiReport joinedReport = new StiReport();
joinedReport.SubReports.Add(rep1, false, true);
joinedReport.SubReports.Add(rep2, false, true);
joinedReport.Show();
-
- Posts: 74
- Joined: Fri Dec 07, 2012 11:35 am
Re: How to Concatinate two Report?
Thanks, Code is good, but i have multiple function creates different-different mrt report accordingly in a defined order (Order change according to user request).
Here I need to append report according to that order.
Hope u get what I want to define.
Regards
Here I need to append report according to that order.
Hope u get what I want to define.
Regards

Re: How to Concatinate two Report?
Hello.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
-
- Posts: 74
- Joined: Fri Dec 07, 2012 11:35 am
Re: How to Concatinate two Report?
Yes, I put your code in my application but the problem is, let have example;
stireport function1()
{
StiReport rep1 = new StiReport();
rep1.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report1.mrt");
rep1.Compile();
rep1.Render();
StiReport rep2 = new StiReport();
rep2.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report2.mrt");
rep2.Compile();
rep2.Render();
StiReport joinedReport = new StiReport();
joinedReport.SubReports.Add(rep1, false, true);
joinedReport.SubReports.Add(rep2, false, true);
return joinedReport ;
}
Function2()
{
StiReport rep3 = new StiReport();
rep3.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report3.mrt");
rep3.Compile();
rep3.Render();
StiReport FinaljoinedReport = new StiReport();
FinaljoinedReport.SubReports.Add(function1(), false, true);
FinaljoinedReport.SubReports.Add(rep3, false, true);
FinaljoinedReport.Show();
}
Here final report only show report generated with function1().
if i change the order like;
FinaljoinedReport.SubReports.Add(rep3, false, true);
FinaljoinedReport.SubReports.Add(function1(), false, true);
then it work fine.
thanks
stireport function1()
{
StiReport rep1 = new StiReport();
rep1.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report1.mrt");
rep1.Compile();
rep1.Render();
StiReport rep2 = new StiReport();
rep2.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report2.mrt");
rep2.Compile();
rep2.Render();
StiReport joinedReport = new StiReport();
joinedReport.SubReports.Add(rep1, false, true);
joinedReport.SubReports.Add(rep2, false, true);
return joinedReport ;
}
Function2()
{
StiReport rep3 = new StiReport();
rep3.Load(@"f:\Support\com\zhang.rs@comlan.com\MSI-444125\Report3.mrt");
rep3.Compile();
rep3.Render();
StiReport FinaljoinedReport = new StiReport();
FinaljoinedReport.SubReports.Add(function1(), false, true);
FinaljoinedReport.SubReports.Add(rep3, false, true);
FinaljoinedReport.Show();
}
Here final report only show report generated with function1().
if i change the order like;
FinaljoinedReport.SubReports.Add(rep3, false, true);
FinaljoinedReport.SubReports.Add(function1(), false, true);
then it work fine.
thanks
Re: How to Concatinate two Report?
Hello.
What's stopping you to add all sub-reports in one function?
Thank you.
What's stopping you to add all sub-reports in one function?
Thank you.