Page 1 of 1

StiReportResponse.ResponseAsJpeg(report, exportSettings, true)

Posted: Thu Nov 19, 2020 6:09 pm
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();
        }
        

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

Posted: Mon Nov 23, 2020 10:37 am
by Lech Kulikowski
Hello,

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

Thank you.

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

Posted: Wed Dec 09, 2020 1:42 pm
by AlharbiN
Thank you!

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

Posted: Thu Dec 10, 2020 10:22 pm
by Lech Kulikowski
Hello,

You are welcome.