The value provided for the report parameter 'InserviceDate' is not valid for its type. (rsReportParameterTypeMismatch) - ssrs-2008

Example
I have an SSRS Report that uses five (5) parameters. When the user selects the first parameter in the report, the subject error occurs. The report errors before allowing the user to enter the parameter that is causing the failure.
The easiest countermeasure would be to provide a default date for the parameter, but it would have negative and unintended consequences with some of the other report parameters.
Ideas?

Related

Multiple Parameters in crystal report

I have created a crystal report layout with 3 parameter.
The 3 parameters are
1.) Date range
2.) Supplier
3.) Location code
User will always give input to the date range but will select either of these remaining two parameters based on the usage.
Is it possible to configure in one single report with optional option in Crystal layout
Assuming you are not using a very old version of Crystal, when you create or edit a parameter, look at the list of parameter properties: one of them is 'Optional Prompt' -- simply change it from the default of False to True.
Then, in your record select logic you can use the HasValue() function to check whether the user provided a value for that parameter.

Ssrs run only one of the subreports based on parameter

I have a report, and the report has 5 subreports. There is a parameter named "SubreportNumber". I want to run one of the subreports, based on that parameter. Just one of them should run. Effectivity is important in my case. Is this possible?
I'm using an IIF statement to hide (using visibility) my reports based on a parameter value, as described above.
Then I take the same approach when specifying the sub-report parameters.
This can basically be done on any one of the parameters, if the report should be showing then pass the parameter, else pass nothing. (If you pass NOTHING as a parameter to the report, it won't run the report, ie. performance increase...)
Example for Year parameter below:
=IIF(Parameters!SubreportNumber.Value = "1","YEAR(NOW)", Nothing)
You can hide the reports you dont want based on your parameter.
To do this: Go the Report's property, under visibility section. Set Show or hide report based on expression. You can write an expression to hide report depending upon your parameter.
This will just hide the reports. Make sure there are no stored procedure or they will be execute irrespective or whether the report is visible or not.

SSRS Textbox Entry Limit Chars

I am looking for a way to limit the entry size of a textbox for an SSRS parameter. The report is being rendered in ReportServer 2008. To be clear, this is NOT a textbox rendered in the report.
The report is accepting a limited number of characters for a text search, and I would like the presentation layer to match the report/SQL logic entry limit. I do not want to get 100 chars passed into a VARCHAR(20) field and produce a silent error.
Thanks!
There is no option to limit the length directly. One possible solution would be to have the report return a warning message indicating that the parameter is too long instead of running the query. You can do this by adding a hidden parameter after the parameter in question to be used as a flag that determines the visibility of the objects on the report.

Reporting services cascading parameter not working

I want the report to pick default date time values based on a location parameter the user picks, but the problem is that the date time parameters don't update when the user picks a different location. I made sure to put the location parameter above the date time parameters but it is still not functioning as I expect, what am I doing wrong here?
Unfortunately this is "by design".
Microsoft Connect - SSRS - default not refreshed for cascading parameters.
Posted by Microsoft in 2007: "As described, this is not
a bug. We do not re-evaluate the default value for a subsequent
parameter unless the selected value is no longer in the valid values
list. We do not know whether the current value was specifically
requested by the user or it is there because of the default. You could
make a case to have control over this behavior through some sort of
property but it is currently working as designed."
I think this is a bug in SSRS. But Microsoft have closed the issue. Please log onto connect and vote this to be fixed if it is affecting you too
Microsoft Connect - Your feedback improving Microsoft products.
Workaround / hack is here: Boyan Penev - SSRS Cascading Parameters Refresh: Solved.
However the hack only works if the dependent parameter has a LIST of valid values, and other users report that it only works for the first dependent parameter.
If the dependent parameter is free-form entry or a date, the hack cannot be used at all.
Consider putting your datetime values in a dataset with logic based on the location parameter
SELECT CASE #Location WHEN 'Paris' THEN GETDATE()+10
WHEN 'Berlin' THEN GETDATE()+11
WHEN 'New York' THEN GETDATE()+8
ELSE GETDATE() END as DefaultDate
Then set the date parameter default value to this dataset.
Unfortunately, SSRS does not refresh cascading parameters once they have been set. Other than reloading the report, the only way that I am aware of is to create a custom UI using the ReportViewerDialog.
I have found that if you use a stored procedure to render the child parameter, by passing in the parent selection, the dataset will get refreshed
I've been having the same issue, and realized it was a simple mistake causing this issue. Posting here for OP and anyone else searching for this issue.
You need to ensure that all parameters, in SSRS, are set to the correct value field, not the display field. You can replicate the cascading parameter issue that many have identified by simply selecting a "Name" field in the parameter default values instead of the "Value" field requested. This will populate the drop down correctly but nothing will be selected, and the cascade will stop. It may then appear as though the cascading parameters are not refreshing because of the Closed be Design issue.
In SSRS In Report Data tab, right click parameter and select
Parameter Properties.
Select Default Values.
Ensure that Value Field is set to the correct value for your sproc, not the value that you present to report users.

Can I assign a value for one parameter

I am using crystal reports 2008. I want to generate a report for which i will get one value from one subreport and i want to pass this value as a parameter so that i can include this value in the sql command.
For eg.
From my subreport i will get customerkey and i want to pass this value in the sql as
{?customerkey}
Sql is 'select card_number from customers where customerkey={?customerkey}'
For this i created parameter in the command and added like this.
But what my problem is this customerkey is getting from subreport(using shared variable).If i get a value customer_key from subreport how will i assign this value to {?customerkey}. I tried like assighning this value but i dont want to popup {?customerkey}this value as a parameter.
Can anyone help? Please
So you want the data shown in the main report to be based on a parameter passed to it from a subreport? I don't think this is possible - the Report Processing Model (described here) states that SubReports are in 'Pass 2', while data retrieval is in 'Pass 1'. This means that the parameter prompt will always appear first.
You might instead be able to have the main report contain TWO subreports, the first of which is used to retrieve the parameter and the second uses it. That can get very messy, especially when dealing with page headers and footers.