How to pass parameters in web dynamically?

Stimulsoft Reports.WEB discussion
Post Reply
rohit
Posts: 15
Joined: Wed Jun 13, 2012 4:18 am
Location: Chandigarh

How to pass parameters in web dynamically?

Post by rohit »

hello,

I am trying to pass parametrs dynamically from textboxes to report,
I am unable to do it.. can anybody suggest??
rahul
Posts: 2
Joined: Wed Jun 13, 2012 7:56 am
Location: chandigarh

How to pass parameters in web dynamically?

Post by rahul »

you can pass textbox values in reports like
report.Dictionary.Variables["varCust_ID"].Value = textboxname.text
here varCust_ID is your variable name,you have to create that variable in stimulsoft designer
rohit
Posts: 15
Joined: Wed Jun 13, 2012 4:18 am
Location: Chandigarh

How to pass parameters in web dynamically?

Post by rohit »

I am doing like this:

StiReport report = StiWebReportFx1.GetReport();
report.Compile();
report.CompiledReport.DataSources["DataSource1"].Parameters["@abc"].ParameterValue = Int32.Parse(TextBox1.Text);

StiWebViewerFx1.Report = report;


But when i use cache mode of reportviewer it displays the result same again and again... and if i use standard or RenderOnlyCurrentPage then it works but paging,%age level or download file not working and if change resolution of report, it refreshes the page and blank report displays as textbox value is not passed....
so what i do??
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to pass parameters in web dynamically?

Post by Alex K. »

Hello,

Please check the following code:

Code: Select all

StiReport report = StiWebReportFx1.GetReport();
report.DataSources["DataSource1"].Parameters["@abc"].Value = TextBox1.Text;
report.Compile();

StiWebViewerFx1.Report = report;
Thank you.
rohit
Posts: 15
Joined: Wed Jun 13, 2012 4:18 am
Location: Chandigarh

How to pass parameters in web dynamically?

Post by rohit »

Thanks,
But can anybody tell me how we can do it in mvc(dynamically)????
rohit
Posts: 15
Joined: Wed Jun 13, 2012 4:18 am
Location: Chandigarh

How to pass parameters in web dynamically?

Post by rohit »

And your code is wrong...
report.Compile();
comes before:
report.CompiledReport.DataSources["DataSource1"].Parameters["@clientid"].ParameterValue = Int32.Parse(TextBox1.Text);

if not then it wil give error that: object reference not set to instance...

Thanks.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

How to pass parameters in web dynamically?

Post by Vladimir »

Hello,

We replied to you in the following forum topic:

http://forum.stimulsoft.com/Default.aspx?g=posts&t=6361

Thank you.
Post Reply