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

Stimulsoft Reports.NET discussion
Post Reply
giangrua
Posts: 3
Joined: Wed Apr 21, 2010 4:25 am
Location: Viet Nam

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

Post by giangrua »

Dear support team!

I use template that located in database, so in design form i don't need show dialog "Save report as", each time when i press button Save.

i was try many ways, and i searched in your forum in two days, but not found any topic can show me, how to design a byte array template that do not show "Save report as" dialog.

This is short description about my issue:

byte[] rptStream ;
//Get data from database and set to rptStream
.....

//Load template from byte array
Stireport.Load(rptStream);

//design this template
Stireport.Design();

//issue is raised in this step, when i save designed report, a dialog is pop up require me save template to file. I don't wan save template to file,

Can you give a solution for this my issue.



Thanks.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

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

Post by Ivan »

Hello,

You can override Save and Load events of WinDesigner.
Please use the static event StiOptions.Engine.GlobalEvents.SavingReportInDesigner, for example:

Code: Select all

.....
StiDesigner.SavingReport += new StiSavingObjectEventHandler(OnSaveReport);
.....

Code: Select all

private static void OnSaveReport(object sender, StiSavingObjectEventArgs e)
{
    e.Processed = false;
    StiDesigner designer = sender as StiDesigner;
    StiReport report = designer.Report;
         ........
            // your code for save report
}
Thank you.
giangrua
Posts: 3
Joined: Wed Apr 21, 2010 4:25 am
Location: Viet Nam

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

Post by giangrua »

Hello Ivan
Thank you very much!

But in OnSaveReport i have small update that is, if remove line code: "e.Processed = false;" then "Save report as" dialog will not display.
With your support my issue have been closed.


Thank you again.


Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

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

Post by Ivan »

Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply