5
votes

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.

3

3 Answers

1
votes

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.

0
votes

It depends too on how you're passing the URL into the sub-report.

If you're passing it via the SubReport object in your main report, and the Action property via the URL option:

enter image description here

I suggest you create the URL string and add to it the Field references you require to fulfill the subreport's parameter requirements.

ie

="http://serverXXXX/ReportServer?/FernandoReports/rptTET&rs:Command=Render&rc:toolbar=false&wsTETID=" + Fields!TETID.Value.ToString()

That way you're forcing SSRS to render the entire field value as one string with the correct value from the Fields table.

0
votes

Check Type Parameter in 2st report Both Parameters!From and Parameters!To are Datetime Type but i dont know what method you call 2st report but in my case I you this way

Right click on Textbox > Properties > select Action on left pane > choose Go to Report option like this image below

enter image description here

Then add parameter to send to 2st report.

Make sure Parameters!From and To (both report) are Datetime Type.