Page 1 of 1

Detecting Excel Export from Report

Posted: Wed Feb 11, 2015 6:57 pm
by simonwhitty
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?

Thanks
Simon :)

Re: Detecting Excel Export from Report

Posted: Thu Feb 12, 2015 9:17 am
by HighAley
Hello, Simon.

Yes, the report is not recompiled when exporting. You could do any changes in report at the Exporting event of the report and call Render method.

Thank you.

Re: Detecting Excel Export from Report

Posted: Fri Feb 13, 2015 11:12 am
by simonwhitty
Thanks Aleksey, Thats Great! :D

Re: Detecting Excel Export from Report

Posted: Fri Feb 13, 2015 11:41 am
by HighAley
Hello.

We are always glad to help.
Let us know if you need any additional help.

Thank you.

Re: Detecting Excel Export from Report

Posted: Mon May 27, 2024 7:15 pm
by bdayakarreddy
Hi Team,

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")}";
}
}

//var settings = new StiPdfExportSettings
//{
// UserAccessPrivileges = StiUserAccessPrivileges.All,
// EmbeddedFonts = false,
// UseUnicode = false,
// StandardPdfFonts = true
//};

var settings = new StiExcelExportSettings();

return await StiAngularViewer.ExportReportResultAsync(this, settings).ConfigureAwait(false);
}

Re: Detecting Excel Export from Report

Posted: Tue May 28, 2024 8:07 am
by Lech Kulikowski
Hello,

> i want to make it generic to support all the types which are in screenshot.

Sorry, we did not exactly understand your question. Could you explain your task in more detail?

Thank you.

Re: Detecting Excel Export from Report

Posted: Tue May 28, 2024 2:26 pm
by bdayakarreddy
Hi Lech,

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.


public IActionResult ExportReport()
{

// Some code before export

// ...

return StiAngularViewer.ExportReportResult(this);
}


https://www.stimulsoft.com/en/documenta ... export.htm



Query 2
I also want to hide the export type HTML. but below options does not work. it still shows the HTML export type when viewing the report.

options.Exports.ShowExportToHtml = false;
options.Exports.ShowExportToHtml5 = false;

Re: Detecting Excel Export from Report

Posted: Wed May 29, 2024 7:25 pm
by Lech Kulikowski
Hello,

We need some time to check this possibility, we will keep you informed about the outcome as soon as possible.

Thank you.

Re: Detecting Excel Export from Report

Posted: Thu May 30, 2024 6:11 am
by Vadim
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;