Page 3 of 4
Re: Using external report as a subreport
Posted: Sat Oct 26, 2024 6:35 am
by noob
Hi Lech, sorry for not clarifying what I want to achieve, I want to use the
like :
Code: Select all
report.subReportUrl = "/GetReport"
the
GetReport is an MVC Controller Action:
Code: Select all
[HttpGet]
public async Task<JsonResult> GetReport()
{
var report = new StiReport();
// here what to return ?
}
Re: Using external report as a subreport
Posted: Mon Oct 28, 2024 4:45 am
by Lech Kulikowski
Re: Using external report as a subreport
Posted: Mon Oct 28, 2024 6:36 am
by noob
Hi,
As I mentioned earlier, I’m using the Stimulsoft.Js viewer, not the ASP.NET Core MVC version. What I need is guidance on how to set the report.subReportUrl property with the report data from the server (via an API or ASP.NET Core MVC controller action). The additional methods you provided are specific to the ASP.NET Core viewer.
Please let me know if this is unclear.
Best Regards,
Re: Using external report as a subreport
Posted: Tue Oct 29, 2024 10:09 am
by Lech Kulikowski
Hello,
How do you provide the report from the server-side on the client?
Thank you.
Re: Using external report as a subreport
Posted: Wed Oct 30, 2024 7:38 am
by noob
Hello,
here is my full code:
Code: Select all
<script type="text/javascript">
StiOptions.WebServer.url = "/DataAdapters";
Stimulsoft.Base.StiLicense.Key = "";
$.ajax({
url: `/ReportViewer/GetReport`,
type: "Get",
data: {
Id: '1',
ReportQuery: 'name=test'
},
contentType: "application/x-www-form-urlencoded",
success: result => {
if (result && result.length > 0) {
var report = new Stimulsoft.Report.StiReport();
report.load(result);
var headerBand = report.getComponentByName("PageHeaderBand1");
var headerReport = new Stimulsoft.Report.Components.StiSubReport();
headerReport.subReportUrl = `/ReportViewer/GetSubReport?HeaderReportId=34&ReportQuery=`;
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 options = new Stimulsoft.Viewer.StiViewerOptions();
options.appearance.scrollbarsMode = true;
options.toolbar.showPrintButton = true;
options.toolbar.showSaveButton = true;
options.toolbar.showAboutButton = false;
options.toolbar.showBookmarksButton = false;
options.toolbar.showParametersButton = false;
options.toolbar.showResourcesButton = false;
options.toolbar.showOpenButton = false;
options.toolbar.showButtonCaptions = false;
var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
report.renderAsync(() => {
viewer.report = report;
viewer.renderHtml('sti-vv');
});
}
}
});
</script>
<div id="sti-vv"></div>
Re: Using external report as a subreport
Posted: Thu Oct 31, 2024 8:06 pm
by Lech Kulikowski
Hello,
Please send us a sample project for analysis.
Thank you.
Re: Using external report as a subreport
Posted: Sun Nov 03, 2024 6:50 am
by noob
Hello Lech,
please check the attached sample project.
Re: Using external report as a subreport
Posted: Wed Nov 06, 2024 10:23 pm
by Lech Kulikowski
Hello,
Unfortunately, in this case, it is not possible.
Thank you.
Re: Using external report as a subreport
Posted: Sat Nov 09, 2024 5:55 pm
by noob
Re: Using external report as a subreport
Posted: Mon Nov 11, 2024 5:27 pm
by Lech Kulikowski
Hello,
Please let us know if you need any additional help.