SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Not getting parameter values on report
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sqlbug
Posting Yak Master

Canada
201 Posts

Posted - 01/28/2013 :  12:40:07  Show Profile  Reply with Quote
Hello,

I have this rdlc report (hosted on a .NET page in a ReportViewer control).
The DataSource for the ReportViewer is an ObjectDataSource with SelectParameters specified that gets it's data from a DataSet.
On the Report itself, I defined the same report parameters with same name.
When I try to display the values for the report parameters, they show only blanks. But the data on the report is good, the DataSet is receiving the parameters correctly and returning right result.

Any idea whats wrong?
Thanks.

James K
Flowing Fount of Yak Knowledge

3589 Posts

Posted - 01/28/2013 :  13:05:54  Show Profile  Reply with Quote
SSRS does not let retrieve parameter values returned from a stored procedure - assuming that that is what you meant. You have to get the values through a dataset.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  13:13:08  Show Profile  Reply with Quote
how are you trying to retrieve the parameters in .NET application?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sqlbug
Posting Yak Master

Canada
201 Posts

Posted - 01/28/2013 :  13:13:12  Show Profile  Reply with Quote
Hi James,
I tried - from the code file (myreport.aspx.cs) like following:
ReportParameter[] param = new ReportParameter[16];
param[0] = new ReportParameter("p_Coverage", tbCoverage.Text);
..
..
RVMyReport.LocalReport.SetParameters(param);

And created the exact same parameter on the rdlc (p_Coverage), even then it did not work.

So - I'm confused whats wrong.

Thanks.
Go to Top of Page

sqlbug
Posting Yak Master

Canada
201 Posts

Posted - 01/28/2013 :  13:29:12  Show Profile  Reply with Quote
Hi Visakh,

The problem is on the report itself, where I want to retrieve the parameter values (passed from the page hosting the report).
So, on the .NET page - the parameters are there. They are sent correctly to the DataSource (DataSet) that correctly displays data on the report.
Only the parameter values can not be retrieved on the report.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3589 Posts

Posted - 01/28/2013 :  13:59:22  Show Profile  Reply with Quote
quote:
Originally posted by sqlbug

Hi James,
I tried - from the code file (myreport.aspx.cs) like following:
ReportParameter[] param = new ReportParameter[16];
param[0] = new ReportParameter("p_Coverage", tbCoverage.Text);
..
..
RVMyReport.LocalReport.SetParameters(param);

And created the exact same parameter on the rdlc (p_Coverage), even then it did not work.

So - I'm confused whats wrong.

Thanks.


Your code seems exactly right - the way you are setting the parameters and that you have defined the parameters with the same names in your report all seem consistent and correct.

The fact that you are able to use those parameters to run the query and get the correct dataset shows that the parameters are getting to the report and even to the database.

So then the problem has to be in where/how you are displaying the parameters. Just for testing purposes, if you set a default value for the report (and don't send the values from .Net page), does that show up on the report correctly?
Go to Top of Page

sqlbug
Posting Yak Master

Canada
201 Posts

Posted - 01/28/2013 :  14:32:00  Show Profile  Reply with Quote
Ah, tried that and didn't work. Tested with simple textboxes - making sure they are visible.
Don't know what to try next.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3589 Posts

Posted - 01/28/2013 :  15:49:50  Show Profile  Reply with Quote
If you create a simple text box and put the parameter into that text box, does that work? If you create a brand new parameter and put its value into a text box does it work? I don't have any specific thoughts or ideas on why this is happening, I am simply thinking of ways of narrowing down the source of the problem.
Go to Top of Page

sqlbug
Posting Yak Master

Canada
201 Posts

Posted - 01/28/2013 :  16:02:48  Show Profile  Reply with Quote
No...it doesn't, only the static text comes up. No parameter values can be seen, they show up on the page that hosts the ReportViewer, but not on the report.
The passing from 1) the .NET page to the ReportViewer or 2) the ReportViewer to the rdlc file is not working.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000