Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing Date as a parameter to a subreport/another report to use as a parameter

I have two reports. The first report selects a report type from a dropdownbox and accepts from/to dates and when click on the view report - lists customer names for this report type.

When you click on the customername, the second report is called (action) passing 3 parameters - customername, datefrom, and dateto as parameters to be used in the second report.

When I run each report individually, both run fine. When I run the first report (select report type, select datefrom/dateto), this report lists all customer names for this report type. When I click on the customername, I am getting an error:

'The value provided for the report parameter 'reportdatefrom' is not valid for its type' (rsReportParameterTypeMismatch)

Please help.

like image 300
user175357 Avatar asked Nov 15 '22 14:11

user175357


1 Answers

Use something like format(Parameters!reportdatefrom.Value,"YYYYMMDD") to force the value into a canonical string before passing it to the subreport.

SSRS sometimes has issues w/ date times. The URL addressability means that all parameter values get converted to strings anyhow, but default conversion rules can run differ between components. One component will generate a date time literal that another component can't read. Usually this is due to non-US regional settings.

Anyhow, to get around this, just convert dates to string literals in ODBC canonical form before passing them around.

like image 99
Peter Radocchia Avatar answered Dec 21 '22 22:12

Peter Radocchia