Author |
Topic |
sqlbug
Posting Yak Master
201 Posts |
Posted - 2013-01-28 : 12:40:07
|
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
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-28 : 13:05:54
|
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. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-28 : 13:13:08
|
how are you trying to retrieve the parameters in .NET application?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2013-01-28 : 13:13:12
|
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. |
|
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2013-01-28 : 13:29:12
|
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. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-28 : 13:59:22
|
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? |
|
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2013-01-28 : 14:32:00
|
Ah, tried that and didn't work. Tested with simple textboxes - making sure they are visible.Don't know what to try next. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-28 : 15:49:50
|
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. |
|
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2013-01-28 : 16:02:48
|
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. |
|
|
|