Page 1 of 1

How to call event to save edited report in windows application

Posted: Mon Jul 04, 2011 1:37 am
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.


How to call event to save edited report in windows application

Posted: Wed Jul 06, 2011 1:09 am
by Alex K.
Hello,

You can use the following event:

Code: Select all

StiOptions.Engine.GlobalEvents.SavingReportInDesigner
Thank you.

How to call event to save edited report in windows application

Posted: Wed Jul 06, 2011 4:56 am
by AbdulAleem
Hi,

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

Thanks,
Abdul Aleem.

How to call event to save edited report in windows application

Posted: Thu Jul 07, 2011 2:05 am
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.

How to call event to save edited report in windows application

Posted: Thu Jul 07, 2011 3:46 am
by AbdulAleem
It is working now..

Thank you so much,

AbdulAleem.

How to call event to save edited report in windows application

Posted: Thu Jul 07, 2011 4:26 am
by Alex K.
Hello,

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

Thank you.