Page 1 of 1

Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Thu Apr 27, 2023 3:09 pm
by Konrad
Hello, my team and I are currently using "Stimulsoft.Reports.Web.NetCore" Version="2022.1.6". I have encountered a problem where, when I attempt to use SaveReport, the web designer prompts me for a name with a save dialog, even though we are using database-coded Reportfiles with LoadReport from byte array.

I have read a similar problem on viewtopic.php?t=3272; however, I am unsure of how to apply the solution to the current version. I cannot find the StiDesigner class and cannot locate the resource to overwrite the SavingReportInDesigner event.

I want to implement my saving method in the StimulsoftReportcontroller, which is connected to my cshmtl. This is the code I am using:

Code: Select all

public async Task<ActionResult> GetDesignerReport(string id)
{
    var json = RequestStorage.Get(id, false);
    var report = new StiReport();
    return StiNetCoreDesigner.GetReportResult(this, report);
}

public async Task<ActionResult> SaveReport(string id)
{
    var requestParams = StiNetCoreDesigner.GetRequestParams(this);
    requestParams.Action = StiAction.SaveReport;
    var report = StiNetCoreDesigner.GetReportObject(this);
    
}
I have omitted some code that is used to retrieve data from the database, but the Stimulsoft logic remains the same.

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Sat Apr 29, 2023 7:44 pm
by Lech Kulikowski
Hello,

Please check the following article:
https://www.stimulsoft.com/en/documenta ... report.htm

Thank you.

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Thu May 04, 2023 6:44 am
by Konrad
I read that, but still don't understand how I can use this for my specific problem. Can you provide some example code or file to show me how I can resolve that issue?

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Tue May 09, 2023 6:31 am
by Lech Kulikowski
Hello,

Please set the ShowSaveDialog="false" option for the designer.

Thank you.

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Thu May 11, 2023 1:20 pm
by Konrad
Hello,

It's possible that I haven't specified my problem clearly. I have some logic in my database and "save" and "save as" controller methods. I don't want a save dialog window to be displayed when "save" is selected. However, it should still be displayed when "save as" is clicked.

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Fri May 12, 2023 6:35 am
by Lech Kulikowski
Hello,

Ok. In that case, please remove option and add the following code:

Code: Select all

<script>
        //where jsStiNetCoreDesigner -> js + Designer ID
        jsStiNetCoreDesigner.onready = function () {
            jsStiNetCoreDesigner.ActionSaveReport = function (nextFunc, autoSave) {
                jsStiNetCoreDesigner.SendCommandSaveReport(false, autoSave);
                if (nextFunc) nextFunc();
            }          
        }
    </script>
Thank you.

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Fri May 12, 2023 7:09 am
by Konrad
I'm a bit confused about how to use the script you gave me in my cshtml file because I'm using the ASP.NET Core MVC Stimulsoft version. Can you explain it in simpler terms or maybe show me an example file? Thanks a lot!

Re: Do not need show dialog "Save report as" when load template from byte array or stream

Posted: Mon May 15, 2023 6:14 pm
by Lech Kulikowski
Hello,

We apologize for the delay, but we need some extra time to prepare a sample for you.

Thank you for your patience.