Page 1 of 1

Programatically fetch drill down report

Posted: Mon May 18, 2020 5:47 pm
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!

Re: Programatically fetch drill down report

Posted: Mon May 18, 2020 8:05 pm
by Lech Kulikowski
Hello,

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

Thank you.