StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Stimulsoft Reports.NET discussion
Post Reply
AlharbiN
Posts: 32
Joined: Wed Jan 02, 2013 1:07 pm

StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Post by AlharbiN »

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

Code: Select all

StiReportResponse.ResponseAsJpeg(report, exportSettings, true);
should solve this issue but, unfortunately, it didn't!

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();
        }
        
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Post by Lech Kulikowski »

Hello,

Please try to set the following option in the browser settings.

Thank you.
Attachments
image_2020-11-23_13-36-45.png
image_2020-11-23_13-36-45.png (32.34 KiB) Viewed 1105 times
AlharbiN
Posts: 32
Joined: Wed Jan 02, 2013 1:07 pm

Re: StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Post by AlharbiN »

Thank you!
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply