June 19, 2008 at 11:42 am
Using SSRS2005, VS2005 (C#). Using Server Reports.
Report has two parameters, which allow nulls. Default for the two parameters
is null. Report runs fine when viewing report initially with null parameters.
Select a non-null value for either/both parameters. Report re-runs fine.
Set parameters back to null. Report re-runs for last selected non-null value
for that parameter.
ie:
All (null)
A (a)
B (b)
When All is initially selected, get both A & B.
When A is selected, get A.
When B is selected, get B.
When All is selected again, get B.
When A is selected, get A.
When All is selected again, get A.
null values are being set as:
Param[0] = new ReportParameter("Section");
non-null values are being set as:
Param[0] = new ReportParameter("Section", SectionValue);
Param array is then passed to a RunReport routine:
rvwReport.ProcessingMode = ProcessingMode.Remote;
rvwReport.ServerReport.ReportServerUrl = new Uri(reportServerUrl);
reportPath = reportPath + reportName;
rvwReport.ServerReport.ReportPath = reportPath;
rvwReport.ServerReport.SetParameters(reportParameters);
rvwReport.RefreshReport();
What has to be done to get the correct (null) value in there?
By tracing our code, we are putting a null in the parameter. But the report
isn't using it.
Thanks,
Wayne
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 24, 2008 at 7:02 am
Resolution:
when setting the parameter specifically to null, do it as:
Param[0] = new ReportParameter("Section", new string[] {null});
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply