StiReportResponse.ResponseAsJpeg(report, exportSettings, true)
Posted: Thu Nov 19, 2020 6:09 pm
Hi,
I'm using C#, MVC .NERT Framework.
The PrintReport function, below, works very well.
The problem is that the report is downloaded and saved to the user directly without any dialog!
I want to allow him to decide where to save the report.
In fact, passing "true" here
should solve this issue but, unfortunately, it didn't!
Any idea on how to display save dialog, please?
Here is my code:
I'm using C#, MVC .NERT Framework.
The PrintReport function, below, works very well.
The problem is that the report is downloaded and saved to the user directly without any dialog!
I want to allow him to decide where to save the report.
In fact, passing "true" here
Code: Select all
StiReportResponse.ResponseAsJpeg(report, exportSettings, true);
Any idea on how to display save dialog, please?
Here is my code:
Code: Select all
public ActionResult PrintReport(int? cid)
{
string sReportAssembly = "TraineesCertificate.dll";
string sPath = Server.MapPath(@"~\Reports") + @"\";
string sImgPath = Server.MapPath(@"~\Reports") + @"\";
string sFullFileName = "";
sFullFileName = sPath + @"\" + sReportAssembly;
StiReport report = StiReport.GetReportFromAssembly(sFullFileName);
StiImageExportSettings exportSettings = new StiImageExportSettings();
report["CID"] = cid;
exportSettings.ImageFormat = StiImageFormat.Color;
exportSettings.ImageType = StiImageType.Jpeg;
StiReportResponse.ResponseAsJpeg(report, exportSettings, true);
return View();
}