I have created a report page using the new Angular libraries and i've been running into some issues. The latest issue is the action ExportReport is never sent back to the server when trying to save the report in any format. Print Preview and Print works, but when I select PDF from the print dropdown, the client side makes the POST request that is not captured by my interceptors so the request gets sent to the UI endpoint and not the server endpoint.
The page allows the user to select a report from the drop down and apply filters. Once the user clicks 'Run Report', the filters and report filename is placed in the 'properties' of the request and parsed on the server side. Here is the function for 'Run Report'
Code: Select all
@ViewChild('stiViewer') stiViewer: StimulsoftViewerComponent;
// ...
// ...
runReport(){
this.reportViewerActive = true;
this.reportSettings.template = this.activeSettings.selectedReport;
this.applyFilters(); //takes the filters from the user and compiles this.reportSettings
this.stiViewer.properties = this.reportSettings;
this.stiViewer.requestUrl = `/api/Stimulsoft/${this.locationId}/{action}`;
this.stiViewer.action='InitViewer';
this.stiViewer.ngOnChanges(null); //triggers the stimulsoft component to update after assigning the url
}
Code: Select all
<div class="flex-item flex-grow" style="min-height: 100%;">
<stimulsoft-viewer-angular
#stiViewer
height="75vh" ></stimulsoft-viewer-angular>
</div>
Code: Select all
[HttpPost("{location}/InitViewer")]
public IActionResult InitViewer([FromRoute]int location)
{
var requestParams = StiAngularViewer.GetRequestParams(this);
var options = new StiAngularViewerOptions();
options.Actions.ViewerEvent = "ViewerEvent";
options.Appearance.ScrollbarsMode = true;
options.Exports.ShowExportDialog = false;
options.Server.CacheMode = StiServerCacheMode.ObjectSession;
StiAngularViewer.CacheHelper = new ScaleitStiCache();
return StiAngularViewer.ViewerDataResult(requestParams, options);
}
[HttpPost("{location}/ViewerEvent")]
public IActionResult ViewerEvent([FromRoute]int location, [FromForm]string properties)
{
var requestParams = StiAngularViewer.GetRequestParams(this);
if (requestParams.Action == StiAction.GetReport)
{
var reportProperties = this.parseProperties(properties);
var stiReport = this.getTemplate(location, reportProperties);
stiReport = this.setTemplateConnection(location, stiReport);
stiReport = this.setTemplateVariables(stiReport, reportProperties);
return StiAngularViewer.GetReportResult(this, stiReport);
}
return StiAngularViewer.ProcessRequestResult(this);
}
front end versions
-initial
-stimulsoft-reports-js 2020.5.1
-stimulsoft-viewer-angular: 2020.5.1-b
-current
-stimulsoft-reports-js 2021.1.1
-stimulsoft-viewer-angular:2021.1.1
Server version
-Stimulsoft.Reports.Angular.NetCore 2020.5.1
Please let me know if you need any additional information, any help would be great.