Page 2 of 4

Re: Using external report as a subreport

Posted: Fri Jun 08, 2018 1:45 pm
by schindlergmbh
Hi,
unfortunately this event is not emitted on my report object.
Do you have a sample or a hint which conditions are necessary that this event is emitted?

Thank you.

Re: Using external report as a subreport

Posted: Wed Jun 13, 2018 8:56 am
by Lech Kulikowski
Hello,

Could you send us a sample which reproduces the issue for analysis?

Thank you.

Re: Using external report as a subreport

Posted: Fri Jun 15, 2018 1:28 pm
by schindlergmbh
Hi,

I found the issue. No it works. I worked on old Stimulsoft script files. --> Sorry.

Re: Using external report as a subreport

Posted: Sun Jun 17, 2018 8:16 am
by Lech Kulikowski
Hello

Ok.
Please let us know if you need any additional help.

Thank you.

Re: Using external report as a subreport

Posted: Tue Oct 15, 2024 11:10 am
by noob
Hello,

im using Stimulsoft.Js 2024.3.3, and want to implement the subreport dynamically from code, here is my code:

Code: Select all

StiOptions.WebServer.url = "/DataAdapters";
Stimulsoft.Base.StiLicense.Key = '';

 var report = new Stimulsoft.Report.StiReport();
 report.load(resultJson);

report.onGetSubReport = function (e) {
    console.log('onGetSubReport', e);
};

var headerBand = report.getComponentByName("PageHeaderBand1");
var headerReport = new Stimulsoft.Report.Components.StiSubReport();
headerReport.clientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0, report.pages.getByIndex(0).width.value, headerBand.height.value);
headerReport.name = 'HeaderSubReport';
headerReport.componentStyle = "SubReport";
headerBand.components.add(headerReport);

var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
report.renderAsync(() => {
    viewer.report = report;
    viewer.renderHtml('sti-viewer');
});
my issue is the "onGetSubReport" never fires, what I'm doing wrong?

Re: Using external report as a subreport

Posted: Wed Oct 16, 2024 8:43 pm
by Lech Kulikowski
Hello,

Try to use the report.subReports.add() method.

Thank you.

Re: Using external report as a subreport

Posted: Sat Oct 19, 2024 7:12 am
by noob
Hello,

this method

Code: Select all

report.subReports.add()
adds the subReport to the second page!!!

Re: Using external report as a subreport

Posted: Mon Oct 21, 2024 8:26 pm
by Lech Kulikowski
Hello,

Please check the following code:
var mreport = new Stimulsoft.Report.StiReport();
mreport.loadFile("../reports/mReport.mrt");

var subreport = mreport.getComponentByName("SubReport1");
subreport.subReportUrl = "../reports/subReport.mrt";

Thank you.

Re: Using external report as a subreport

Posted: Tue Oct 22, 2024 9:17 am
by noob
Hi,

what to return from MVC Controller action for

Code: Select all

subreport.subReportUrl
?

Re: Using external report as a subreport

Posted: Wed Oct 23, 2024 8:32 am
by Lech Kulikowski
Hello,

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

Thank you.