StiwebReport parameters

Stimulsoft Ultimate discussion
Post Reply
themasterkenen
Posts: 5
Joined: Tue Apr 22, 2014 6:57 pm

StiwebReport parameters

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: StiwebReport parameters

Post 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.
themasterkenen
Posts: 5
Joined: Tue Apr 22, 2014 6:57 pm

Re: StiwebReport parameters

Post 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!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: StiwebReport parameters

Post 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.
themasterkenen
Posts: 5
Joined: Tue Apr 22, 2014 6:57 pm

Re: StiwebReport parameters

Post by themasterkenen »

Thank you for your help!!! It was very good to me.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: StiwebReport parameters

Post by Alex K. »

Hello,

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

Thank you.
Post Reply