How to call event to save edited report in windows application

Stimulsoft Ultimate discussion
Post Reply
AbdulAleem
Posts: 37
Joined: Tue Sep 15, 2009 9:42 am
Location: jeddah

How to call event to save edited report in windows application

Post by AbdulAleem »

Hi,


In web application I was able to attach StiWebDesigner1_SaveReport and StiWebDesigner1_SaveReportAs events to StiWebDesigner and edit the report successfully

I want to edit the report in windows application,how can I attach onsavereport event in windows application.

I am storing the report in the string format in database,
I can load the report from string from database and call the report.Design() function which opens the report in an editor,
After editing the report I want to store it back to database(here Iam unable to find how to use onsavereport event in windows application.

Thanks,
AbdulAleem.

Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to call event to save edited report in windows application

Post by Alex K. »

Hello,

You can use the following event:

Code: Select all

StiOptions.Engine.GlobalEvents.SavingReportInDesigner
Thank you.
AbdulAleem
Posts: 37
Joined: Tue Sep 15, 2009 9:42 am
Location: jeddah

How to call event to save edited report in windows application

Post by AbdulAleem »

Hi,

Can you please provide sample code for using this handler -- StiOptions.Engine.GlobalEvents.SavingReportInDesigner

Thanks,
Abdul Aleem.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to call event to save edited report in windows application

Post by Alex K. »

Hello Abdul Aleem,

Please see the sample code:

Code: Select all

private void btnDesign_Click(object sender, EventArgs e)
{
     StiOptions.Engine.GlobalEvents.SavingReportInDesigner += new  
           Stimulsoft.Report.Design.StiSavingObjectEventHandler(GlobalEvents_SavingReportInDesigner);
     StiReport report = new StiReport();
     report.Design();
}

void GlobalEvents_SavingReportInDesigner(object sender, Stimulsoft.Report.Design.StiSavingObjectEventArgs e)
{
     // Your code for save report
     //string s = ((StiDesignerControl)sender).Report.SaveToString();
     //...
     e.Processed = true;
}
Thank you.
AbdulAleem
Posts: 37
Joined: Tue Sep 15, 2009 9:42 am
Location: jeddah

How to call event to save edited report in windows application

Post by AbdulAleem »

It is working now..

Thank you so much,

AbdulAleem.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to call event to save edited report in windows application

Post by Alex K. »

Hello,

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

Thank you.
Post Reply