Access to Closed event

Stimulsoft Ultimate discussion
Post Reply
nimam2008
Posts: 8
Joined: Sun Dec 05, 2010 12:05 am
Location: india

Access to Closed event

Post by nimam2008 »

pls. tell me how i can to access to Closed event Stimulsoft?
for more explanation:
i want to, my program(C#) do something when user closed the Report form.

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

Access to Closed event

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

        private void btnDesign_Click(object sender, EventArgs e)
        {
            StiReport report = new StiReport();
            StiOptions.Engine.GlobalEvents.ClosingDesigner += new CancelEventHandler(GlobalEvents_ClosingDesigner);
            report.Load();
            report.Design();
        }

        void GlobalEvents_ClosingDesigner(object sender, CancelEventArgs e)
        {
            // your code 
        }

Thank you.
nimam2008
Posts: 8
Joined: Sun Dec 05, 2010 12:05 am
Location: india

Access to Closed event

Post by nimam2008 »

Very Thanks for your solution, but I need to Closed event of Report .
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Access to Closed event

Post by Ivan »

Hello,

Sorry, maybe we did not exactly understood your question. Could you explain your issue in more details.

Thank you.
nimam2008
Posts: 8
Joined: Sun Dec 05, 2010 12:05 am
Location: india

Access to Closed event

Post by nimam2008 »

of course;

i use from belwo code for show my report

Code: Select all


stiReportRA.Load("..\\..\\stiReportRA.mrt");
.
.
.
stiReportRA.Show();

and when user closed the Report then my program do something.

actually, i want one code like Aleksey's Code but with Closed Event for Report that displayed and not for report Designer.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Access to Closed event

Post by Alex K. »

Hello,

In this case, you can use the StiViewerControl

Code: Select all

StiReport report = new StiReport();
report.Load();
...
stiViewerControl1.Report = report;
stiViewerControl1.Close += new EventHandler(stiViewerControl1_Close);
...

void stiViewerControl1_Close(object sender, EventArgs e)
{
    \\ your code
}
Thank you.
Post Reply