Saving Report Without Business objects

Stimulsoft Reports.BLAZOR discussion
Post Reply
admin@secsol.co.uk
Posts: 16
Joined: Wed Jun 01, 2022 8:26 am

Saving Report Without Business objects

Post by admin@secsol.co.uk »

I would like to remove the business objects from my report before saving it to the disk.

I have attached some code to the OnSaveReport - where I can remove the business objects but how do I finish saving the report to disk form here?

Code: Select all

  <StiBlazorDesigner @ref="@Designer" Options="@options" Report="@SelectedReport.SReport" OnSaveReport="DesignerSaveReport" />

    private void DesignerSaveReport(StiReportDataEventArgs args)
    {
        args.Report.Dictionary.BusinessObjects.Clear();


    // How to finish saving report here?
   }
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Saving Report Without Business objects

Post by Max Shamanov »

Hello,

We need time to prepare an answer for you.

Thank you.
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Saving Report Without Business objects

Post by Max Shamanov »

Hello,

You can use the following code:

Code: Select all

 
 private void SaveReport(StiSaveReportEventArgs args)
    {
        
        var reportCopy = new StiReport();
        var stream = new MemoryStream();
        args.Report.Save(stream);
        stream.Seek(0, SeekOrigin.Begin);
        reportCopy.Load(stream);
        stream.Close();

        reportCopy.Dictionary.BusinessObjects.Clear();
        reportCopy.Save("D:\\ReportWithoutBO.mrt");

    }
 
Thank you.
Post Reply