Run an event to go to the Screen Designer

Stimulsoft Reports.NET discussion
Post Reply
gsabel
Posts: 8
Joined: Tue Jan 17, 2012 7:48 am
Location: Brazil

Run an event to go to the Screen Designer

Post by gsabel »

Hi people,
I'm sorry for my english x)

I need to make an application that runs an action when I go to the Preview screen and when I go to the Designer screen.

At the moment, when I go to the Preview Screen, I use this event:

Code: Select all

StiOptions.Engine.GlobalEvents.ReportCompiling += ...
Now, I'm on the Preview screen and I wish to return to the Designer screen,
but when this happens, I need to execute a method.

Right now I am using this event:

Code: Select all

public Form1()
{
     InitializeComponent();
     StiOptions.Engine.GlobalEvents.ReportCompiling += new EventHandler(GlobalEvents_ReportCompiling);
     StiPage.PagePainting += new StiPagePaintEventHandler(StiPage_PagePainted); //I need to replace this event with one that runs only when I go to Designer Screen
}

private void StiPage_PagePainted(object sender, EventArgs e)
{
     if ((e as StiPagePaintEventArgs).IsDesigning) //and here I check which screen is going
     {
          //Runs when open the Designer Screen...
     }
}
void GlobalEvents_ReportCompiling(object sender, EventArgs e)
{
     //Runs when open the Preview Screen...
}
The problem with StiPage.PagePainting += ... is that it runs every time a change occurs on report.

Thank you.

HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Run an event to go to the Screen Designer

Post by HighAley »

Hello.
gsabel wrote:Hi people,
I'm sorry for my english x)

I need to make an application that runs an action when I go to the Preview screen and when I go to the Designer screen.

At the moment, when I go to the Preview Screen, I use this event:

Code: Select all

StiOptions.Engine.GlobalEvents.ReportCompiling += ...
Now, I'm on the Preview screen and I wish to return to the Designer screen,
but when this happens, I need to execute a method.

Right now I am using this event:

Code: Select all

public Form1()
{
     InitializeComponent();
     StiOptions.Engine.GlobalEvents.ReportCompiling += new EventHandler(GlobalEvents_ReportCompiling);
     StiPage.PagePainting += new StiPagePaintEventHandler(StiPage_PagePainted); //I need to replace this event with one that runs only when I go to Designer Screen
}

private void StiPage_PagePainted(object sender, EventArgs e)
{
     if ((e as StiPagePaintEventArgs).IsDesigning) //and here I check which screen is going
     {
          //Runs when open the Designer Screen...
     }
}
void GlobalEvents_ReportCompiling(object sender, EventArgs e)
{
     //Runs when open the Preview Screen...
}
The problem with StiPage.PagePainting += ... is that it runs every time a change occurs on report.
There is no such event.
Please, describe what are you trying to do when you return to the Designer screen and we'll try to help you other way.

Thank you.
gsabel
Posts: 8
Joined: Tue Jan 17, 2012 7:48 am
Location: Brazil

Run an event to go to the Screen Designer

Post by gsabel »

We do not need more of this event. kk

But thank you. :)
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Run an event to go to the Screen Designer

Post by Andrew »

Hello,

As far as I understand your issue is solved isn't it?

Thank you.
gsabel
Posts: 8
Joined: Tue Jan 17, 2012 7:48 am
Location: Brazil

Run an event to go to the Screen Designer

Post by gsabel »

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

Run an event to go to the Screen Designer

Post by Alex K. »

Hello,

Ok.
Let us know if you need any additional help.

Thank you.
Post Reply