Page 1 of 1

StiwebReport parameters

Posted: Mon Jun 09, 2014 6:25 pm
by themasterkenen
Hello!
I am using Stimulsoft Ultimate And Visual Studio 2010 for a web project. I made a report and I send params (variables). I use the StiWebViewer but I always have to press the submit button for reload and execute the report with the params. By the way, when I choose save in any format (PDF,Word, XLS, etc) the report is downloaded without the value params.
In my Default.aspx I have the next code:

protected void Page_Load(object sender, EventArgs e)
{
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiMySqlAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiMySqlDatabase());

StiReport report = StiWebReport1.GetReport();

report["reporte_id"] = (Request.QueryString["reporte_id"]!= null)?Request.QueryString["reporte_id"]:"" ;

StiWebViewer1.Report = report;

}

Can you help me? How Can I send the params value when I save my report? How Can I print the params in the box of params?
Thank you.

Re: StiwebReport parameters

Posted: Tue Jun 10, 2014 11:16 am
by Alex K.
Hello,

Please try to use the Compile() method before pass the value for parameters.

Code: Select all

...
report.Compile();
report["reporte_id"] = (Request.QueryString["reporte_id"]!= null)?Request.QueryString["reporte_id"]:"" ; 
...
Also please try to set the RenderMode="AjaxWithCache" property for the WebViewer.

And please try to correct code in Page_Load event:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
{
  if (!Page.IsPostBack)
    {
       // your code
    }
}
Thank you.

Re: StiwebReport parameters

Posted: Tue Jun 10, 2014 3:03 pm
by themasterkenen
Thank you! But now I have another problem. I set a Table of Content (I took the example with the BeginRender and EndRender), but this is not execute at first time. How Can I solve it ?
Greetings!

Re: StiwebReport parameters

Posted: Wed Jun 11, 2014 5:56 am
by Alex K.
Hello,

Please try to use the Render() method. If it is does not help please send us a sample project which reproduce the issue for analysis.

Thank you.

Re: StiwebReport parameters

Posted: Mon Feb 09, 2015 11:42 pm
by themasterkenen
Thank you for your help!!! It was very good to me.

Re: StiwebReport parameters

Posted: Tue Feb 10, 2015 6:07 am
by Alex K.
Hello,

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

Thank you.