Creating reports and dashboards | Stimulsoft community forum
Reporting tool and data analytics tools for creating reports and dashboards in ASP.NET, ASP.NET MVC, .NET Core, Blazor, Angular, PHP, Python, WPF, JavaScript, and Java applications.
Hi Guys.
We are exporting the report to Excel from the Preview Window and they would like a new page triggered only during export. I have tried using the this.IsExporting, called from various events on the page with no luck.
Can i confirm that the report is not recompiled when exporting from the preview window? - that it exports as seen on screen?
We save the report some times as pdf or some times as excel or etc.
how do we detect the selected export type in the .net ExportReport endpoint ? i shared screenshot and .net server side code, currently the code supports Excel export only, i want to make it generic to support all the types which are in screenshot.
We are using below npm packges in angular "stimulsoft-designer-angular": "2023.3.4",
"stimulsoft-viewer-angular": "2023.3.4",
for Server side we are using Stimulsoft.Reports.Angular.NetCore 2023.1.5.
/// <summary>
/// Handles Report Export Event.
/// </summary>
/// <returns></returns>
[HttpPost("exportReport", Name = "ExportReport")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> ExportReport()
{
var requestParams = StiAngularViewer.GetRequestParams(this);
if (requestParams.Action == StiAction.ExportReport)
{
StiReport report = StiAngularViewer.GetReportObject(this);
if (report != null)
{
report.ReportName = $"{report.ReportName}_{DateTime.UtcNow.ToString("yyyyMMddHHmm")}";
}
}
Query 1
I want to know whether user exporting the report as pdf or excel or etc? i want to identify the export type in below .net ExportReport endpoint.
Hello.
1.
In StiRequestParams object you will get necessary information
public IActionResult ExportReport()
{
var requestParams = StiAngularViewer.GetRequestParams(this);
2. Also you need to hide options.Exports.ShowExportToMht = false;