Using external report as a subreport.
Using external report as a subreport.
Good day.
I want to know if it is possible to use an external report (e.g. a one page report that displays a clients details) as a subreport in another report.
What I want to do is have a report list all the clients then for each client load the external report that displays the details.
That way we can reuse the client details report on other reports.
(generic example, we want to create hundreds of little reports that we can use on a few big reports and perhaps use those big reports in a huge month end report)
Thank you :biggrin:
I want to know if it is possible to use an external report (e.g. a one page report that displays a clients details) as a subreport in another report.
What I want to do is have a report list all the clients then for each client load the external report that displays the details.
That way we can reuse the client details report on other reports.
(generic example, we want to create hundreds of little reports that we can use on a few big reports and perhaps use those big reports in a huge month end report)
Thank you :biggrin:
Using external report as a subreport.
Hello!
You can try use property SubReports of StiReport. Please see attached sample project.
Thank you.
You can try use property SubReports of StiReport. Please see attached sample project.
Thank you.
- Attachments
-
- SubReports.zip
- (6.28 KiB) Downloaded 725 times
Using external report as a subreport.
That is really awesome.
Now I just have one more question.
Is there a way to use a data list to load sub reports?
I want to create a sub report that displays details depending on a "parameter" and a data list that generates that "parameter"
I want to list all the products bought by a client and pass the product code for each product to the product details reports.
Then I want to create a report that creates this report for all our active clients.
But what is really important is that I want to use external reports for each step. I may want to use the product details on its own, or run a single client report.
I really look forward to your reply.
Thanks.
Now I just have one more question.
Is there a way to use a data list to load sub reports?
I want to create a sub report that displays details depending on a "parameter" and a data list that generates that "parameter"
I want to list all the products bought by a client and pass the product code for each product to the product details reports.
Then I want to create a report that creates this report for all our active clients.
But what is really important is that I want to use external reports for each step. I may want to use the product details on its own, or run a single client report.
I really look forward to your reply.
Thanks.
Using external report as a subreport.
We will add this possibility on 9 August.
Thank you.
Thank you.
Using external report as a subreport.
You can check build from 10 August. Set new property UseExternalReport to true. property SubReportPage to null. After then you need add event handler to event GetSubReport of StiReport object:
Also you need detect current line of specified datasource. You can use following code in event handler:
Received value you can use as variable in subreport.
Thank you.
Code: Select all
private void OnGetSubReport(object sender, StiGetSubReportEventArgs e)
{
StiReport report = new StiReport();
report.Load("d:\\SimpleGroup.mrt");
DataSet data = new DataSet();
data.ReadXml("d:\\demo.xml");
data.ReadXmlSchema("d:\\demo.xsd");
report.RegData("Demo", data);
e.Report = report;
}
report.GetSubReport += new StiGetSubReportEventHandler(OnGetSubReport);
Code: Select all
StiReport parentReport = sender as StiReport;
StiDataSource data = parentReport.Dictionary.DataSources["MyDataSource"];
object value = data["MyColumn"];
Thank you.
Using external report as a subreport.
Thank you very much!
I will implement it this weekend :grinder:
I will implement it this weekend :grinder:
Using external report as a subreport.
If you will have any problems, please, inform us, because this option is a new.
Thank you.
Thank you.
Using external report as a subreport.
Hi Pavel.
I cannot get the external subreports to work. :dumb:
Can you perhaps send me a sample project?
Thanks.
I cannot get the external subreports to work. :dumb:
Can you perhaps send me a sample project?
Thanks.
Using external report as a subreport.
The problem is fixed. Fix will be available in the build from August, 23.
Thank you.
Thank you.
Using external report as a subreport.
Hi Guys.
I updated to the newest version of Stimulsoft and now subreporting does not work any more.
The data.position stays at 0. Any idea what is going on?
Thanks.
I updated to the newest version of Stimulsoft and now subreporting does not work any more.
Code: Select all
Dim parentReport As Stimulsoft.Report.StiReport = TryCast(sender, Stimulsoft.Report.StiReport)
If parentReport Is Nothing Then
Exit Sub
End If
Dim comp As Stimulsoft.Report.Components.StiComponent = parentReport.GetComponentByName(e.SubReportName)
If comp Is Nothing Then
Exit Sub
End If
Dim dataBand As Stimulsoft.Report.Components.StiDataBand = comp.GetDataBand()
If dataBand Is Nothing Then
'This subreport is not on an databand. Just display it.
Else
'Databand found.
Dim data As Stimulsoft.Report.Dictionary.StiDataSource
data = parentReport.Dictionary.DataSources(dataBand.DataSourceName)
If data Is Nothing Then
Exit Sub
End If
Dim value As Object = data("CODE")
If value Is Nothing Then
Exit Sub
End If
Debug.WriteLine(data.Position & " ->" & value.ToString)
End If
Thanks.