Unable to pass parameters from Data Set
Hi,
The Views reside on the Composite Information Server and I use ODBC to fire the DSN. I created three parameters and when I try to reference them in the Shared Data Set as (Select 1,2,3 from View 1 where Region=@Area and Dated between @startdate and
@enddate) it throws an error:
TITLE: Microsoft SQL Server Report Designer
------------------------------
An error occurred while executing the query.
ERROR [HY000] Unable to parse query text: unexpected char: '@'. On line 4, column 11. [parser-2904201]
Cause: unexpected char: '@'
------------------------------
ADDITIONAL INFORMATION:
ERROR [HY000] Unable to parse query text: unexpected char: '@'. On line 4, column 11. [parser-2904201]
Cause: unexpected char: '@' (Composite Software 6.2.6 ODBC Driver)
------------------------------
Please help.
February 16th, 2015 9:10am
While creating the dataset using the query "Select 1,2,3 from View 1 where Region=@Area and Dated between @startdate and @enddate" we also need to map the query parameter with report parameter.
If you have not added any report parameter then add 3 parameters of appropriate datatype i.e Area, StartDate and EndDate. Finally mapped it in the dataset parameter tab.
February 16th, 2015 9:27am
Hey
Many thanks for that.
This goes through but then another error comes up that "Unable to allocate Environment Handle". Looks like there's some issue with ODBC driver.
February 16th, 2015 11:09am
Heyy Solved it. Deleted the User DSN as it was corrupted. Created it afresh and then it worked.
February 16th, 2015 11:56am
Ideally when you run the query using parameters in dataset designer it will prompt for parameters and given values it will run and give you the results.
On refreshing the dataset the parameters as well as field information gets automatically added to dataset properties. So most cases only thing you may need to do is to just go to parameter properties and change parameter type,prompt name and map dataset
if any to fill the values.
However when you use ODBC the parameter should be indicated by ? placeholders and then you need to map it in dataset properties to corresponding placeholders against actual report parameters
see
http://davoscollective.com/2013/multivalue-parameters-in-ssrs/
February 16th, 2015 12:38pm
Turning the values to ? is what solved the issue for me earlier
February 16th, 2015 1:15pm
Also, I've four values (Area 1, Area 2, Area 3, Area 4) for the Area parameter in this report and each value needs to refer to a View. I need to update the report with that View when the user selects that Area. How can this be done?
February 17th, 2015 12:56am
Also, I've four values (Area 1, Area 2, Area 3, Area 4) for the Area parameter in this report and each value needs to refer to a View. I need to update the report with that View when the user selects that Area. How can this be done?
As per what I understand your query should be like this
SELECT Columns..
FROM View1
WHERE @Area = 'Area 1'
UNION ALL
SELECT Columns..
FROM View2
WHERE @Area = 'Area 2'
UNION ALL
SELECT Columns..
FROM View3
WHERE @Area = 'Area 3'
UNION ALL
SELECT Columns..
FROM View4
WHERE @Area = 'Area 4'
February 17th, 2015 1:47am
I need to elaborate a bit. Am in the Report Designer and have one parameter AREA that has four integer values. When user clicks on a value (or the label linked to it), the pyramid chart populates -- with two varying levels. Then, the user can click on any
level to drill down further.
My question is:
How to dynamically assign the parameter value and then pass it on to the next level of reporting?
PS: Am unable to post screenshots or else it would be have been much easier, my friend, for you to understand my bottleneck.
February 17th, 2015 3:34am
I need to elaborate a bit. Am in the Report Designer and have one parameter AREA that has four integer values. When user clicks on a value (or the label linked to it), the pyramid chart populates -- with two varying levels. Then, the user can click on any
level to drill down further.
My question is:
How to dynamically assign the parameter value and then pass it on to the next level of reporting?
PS: Am unable to post screenshots or else it would be have been much easier, my friend, for you to understand my bottleneck.
You can use an expression for grouping based on parameter value
http://www.codeproject.com/Articles/15055/Dynamic-Data-Grouping-using-Microsoft-Reporting-Se
February 17th, 2015 3:55am