Page 1 of 1

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Fri Aug 28, 2009 2:16 pm
by mvines
I have a requirement to be able to optionally go straight into the report designer on page load loading a report template. I am accomplishing this right now with the following Page_PreRender event handler.

Code: Select all

protected void Page_PreRender(object sender, EventArgs e)
    {
        if (Session["AdHocReporting_ShowDesigner"] != null && (bool)Session["AdHocReporting_ShowDesigner"])
        {
            Session["AdHocReporting_ShowDesigner"] = false;
            ShowReportDesigner(); //code that loads my report into the designer.
        }
    }
Certainly not the cleanest thing in the world, but it works well enough. My issue is that once I load the web designer like this, I can't exit out of it. When I click exit, it just reloads the designer. I think the code to reload the designer is being called before my page lifecycle events (I know it is called before page load, but I still need to check if page_init is called.) So I haven't been able to really learn much about it so far.

So why doesn't the exit button actually exit the designer in this case? The same page works just fine when a button click instantiates and loads the designer. What can I do to get this execution path to function correctly?

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Fri Aug 28, 2009 5:40 pm
by Edward
Hi

Please try the following code:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
{
string keyValue = Page.Request.QueryString.Get("stimulsoft_webdesigner");
if (!IsPostBack && keyValue == null)
{
StiReport report = new StiReport();
report.Load(HttpContext.Current.Server.MapPath(string.Empty) + "\\Reports\\myreport.mrt");
StiWebDesigner1.Design(report);
}
} 
Thank you.

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Mon Aug 31, 2009 4:12 pm
by mvines
The code you provided does allow me to place the ShowReportDesigner code in my page load event handler instead of Page_PreRender. However, I am still unable to exit the report designer by clicking exit in the menu.

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Thu Sep 03, 2009 5:47 am
by Jan
Hello,

Report designer redirects to page url which is used before running report designer. Report designer will be reloaded if your first page is page where report designer is placed and you load report designer in PageLoad event. We can add special property - ExitUrl to StiWebDesigner component. Property will be available in next builds.

Thank you.

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Thu Sep 03, 2009 10:36 am
by mvines
Thanks guys, this will make things much simpler.

Keep up the good work.

[resolved] How to exit the web designer when loaded from Page_PreRender

Posted: Fri Sep 04, 2009 2:45 pm
by Jan
Hello,

Please contact us if you need any help.

Thank you.