Programatically fetch drill down report

Stimulsoft Reports.WEB discussion
Post Reply
emanuelv
Posts: 20
Joined: Fri Sep 13, 2019 5:46 pm

Programatically fetch drill down report

Post by emanuelv »

Hello,

I am running a .NET Core web app and would like to know if there's a way to programatically get a drill down report. For example, when I create the drill-down interaction in the report, I can either specify a page on the report or a URL. I cannot use a URL since our report templates are fetched as JSON via an API behind authentication. So instead of specifying a page, I'd like to be able to still pass down the drill-down parameters, but in the controller, I'd like to be able to access the drill down parameters, fetch the drill down report via our API, then fetch the data for it via another API call, register the data with the report template that was fetched and then display it as the drill down report.
In other words, can something like this be done?

Code: Select all

[HttpPost]
public IActionResult Post()
{
	var requestParams = StiNetCoreViewer.GetRequestParams(this);
	if (requestParams.Component == StiComponentType.Viewer)
	{
		switch (requestParams.Action)
		{
			case StiAction.GetReport:
				return GetReport();
			case StiAction.DrillDown:
				var drillDownParameters = GetDrillDownParameters(); // I have working code that does this already
				var drillDownReport = new StiReport();
				drillDownReport.Load(ApiCallToGetJsonTemplate());
				var drillDownReportData = StiJsonToDataSetConverterV2.GetDatSet(ApiCallToGetData(drillDownParameters));
				drillDownReport.RegData("NameOfDataSourceInDrillDownReport", drillDownReportData);
				realReport.SetDrillDownReport(drillDownReport); // Is it possible to somehow accomplish this? Setting the drill down report to a Report object?
		}
	}
	return StiNetCoreViewer.ProcessRequestResult(this);
}
Are there some working code examples that I would be able to look at?
Thanks so much!
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Programatically fetch drill down report

Post by Lech Kulikowski »

Hello,

Unfortunately, in the NET Core version, events are not supported.

Thank you.
Post Reply