Page 1 of 1

Run an event to go to the Screen Designer

Posted: Wed Jan 18, 2012 7:05 am
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.


Run an event to go to the Screen Designer

Posted: Thu Jan 19, 2012 3:14 am
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.

Run an event to go to the Screen Designer

Posted: Thu Jan 19, 2012 1:23 pm
by gsabel
We do not need more of this event. kk

But thank you. :)

Run an event to go to the Screen Designer

Posted: Fri Jan 20, 2012 12:05 am
by Andrew
Hello,

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

Thank you.

Run an event to go to the Screen Designer

Posted: Fri Jan 20, 2012 6:28 am
by gsabel
yes

Run an event to go to the Screen Designer

Posted: Fri Jan 20, 2012 7:29 am
by Alex K.
Hello,

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

Thank you.