My report has multiple parameters where the data populated in the dropdown does not show proper data. My parameter is suppose to populate 3 values(Say A, B, All). My parameters are populating just the ALL value in the drop down.
I have checked the query in the HANA Studio and the query is absolutely fine and gives A, B and All in the output but the same wont work in SSRS.
SSRS Version: 2017
Data Source : SAP HANA
The parameter works absolutely fine in the dev environment but gives the above mentioned issues in other environment.
How can I get all the 3 values in the parameter drop down?
Use this in the expression in your Query parameter when you are dealing with multi value parameters:
join(Parameters!<your param name>.Value,",")
Related
Scenario: I am working with a Firebird database (somewhat similar to MySQL) connected to Microsoft SSRS 2012 via ODBC connection manager.
I have a huge stored procedure (which I am not supposed to modify at all) given by our client. The stored procedure has a parameter - Parameter X filtering Column X (integer datatype); when I pass values to Parameter X - say 1,2,3,4... individually, I am able to run the report correctly in SSRS.
However, when I try to pass a string of values - (1,2,3,4...) - i.e. (by checking) 'Allow multiple values' for this Parameter X (text datatype) in SSRS Report Parameter Properties box, I get this error -
'Cannot add multi value parameter '?' for dataset XYZ because it is
not supported by the data extension. (XYZ is the main dataset for this report)
The values 1,2,3 are passed as input from another dataset (PQR).
How can I pass multiple input values (1,2,3,...) to Parameter X from this PQR dataset ?
As I have mentioned, I cannot modify the PSQL Firebird stored procedure (main dataset XYZ) at all. The procedure reads something like this for filtering Column_X:
WHERE :Parameter_X CONTAINING Column_X
Now if :Parameter_X = 1 or 2 or 3 individually passed from dataset PQR, SSRS report works fine.
If :Parameter_X = (1 ,2, 3, ....) multi values passed from dataset PQR, SSRS report throws the above error.
I can modify the dataset PQR, but not the main dataset XYZ.
Any suggestions ?
Join(Parameters!ParameterX.Value,",") still works. In my case it was using OLE DB connection type instead of regular ORACLE in Report Manager.
It seems OLE DB could not parse Join(Parameters!ParameterX.Value,",") .
I am creating a report with columns say A,B,C,D,E. I am setting up a drill down on the column A that fetches one more report with Columns
G,H,I,J. The values for the columns G,H,I are from taken the columns A B C. For the column J,I need to pass a parameter explicitly(not from the source report). I set that parameter in
the properties section -> Available Values and mentioned the values. I ran the main report and get the following error
The Parameter J is a missing value
I am pretty much new to the SSRS projects and would be great if I could any assistance on this
It sounds like you are putting parameter J in the wrong place. It doesn't go in the Parameters collection for the main report but in the parameters that are passed to the sub-report.
Right-click the cell with the drill-down and select Text Box Properties.... Choose Action from the left-hand menu and it will show the drill-down report. Under this it says Use these parameters to run the report:
Add the parameters of the sub-report and the values you are passing. You can use an expression to provide the value for parameter J.
I will try to explain the issue as best as I can by oversimplifying the report structure. Report one contains 1 group called ResourceCenter and then one line of totals under it. The totals are actually a group but the grouping is done in SQL and are presented in a detail group. The report looks something like this:
Report 1
ResourceCenter 1
Total1 11
Total2 4
Total3 8
ResourceCenter2
Total1 12
Total2 11
Total3 6
From this report, I need to drill through to another report that has a bunch of multi-valued parameters. For the drillthrough, I am able to use single values for everything except for EmployeeNumber. For that, I need to be able to pass a list of EmployeeNumbers to the multi-valued parameter in Report 2. The EmployeeNumbers are not currently present in any DataSet or parameter in Report 1 but are based on ResourceCenter. So, if the user has run Report 1 and clicks on ResourceCenter 1, I need to be able to pass a list of EmployeeNumbers associated with ResourceCenter 1 to the multi-valued parameter in Report 2 in a way that Report 2 will handle it correctly.
NOTE: I should add that I have created two SQL functions that accept an input of ResourceCenter and then return a list of employees. One is a table-valued function that returns a single column of EmployeeNumbers. The other is a scalar-valued function that returns the EmployeeNumbers as comma-separated values. I then have some custom code that runs the SQL function in the background and returns the list. I have not had any success with returning a dataset that SSRS can use but I have been able to get the scalar-valued function to 'work' in the sense that I can create a field on a dummy report and see the output. I have not had any luck getting Report 2 to accept a comma-separated list, though.
This person was doing a drill-through and appears to have solved a similar problem with a multi-value parameter. In that case it had to be formatted for an IN clause.
=SPLIT(JOIN(Parameters!SomeParameterName.Value,","),",")
If Report2 won't take it in this format, you might have to add a separate single-valued parameter that will accept a comma-separated string, which you then have to parse.
I'm using SSRS 2016, and my datasets are based on stored procedures, but passing multi-value parameters to a drill down doesn't seem to be an issue anymore. By default, when you select a multi-value parameter it gives you something like Parameters!ParName(0).Value which would pass just the first value. But if you remove the (0) and just leave it as Parameters!ParName.Value, it seems to be passing all values fine.
I'm using SQL Server Reporting Services for SQL 2008 R2. My reports are filtered by two drop-down menus that are populated from a table, one of them displays a build number. I'd like to give users the option to choose "All" and so return data for all build numbers and not just one.
How do I add this option to my drop-down filter and make it work correctly?
Thanks very much for any help provided.
J.
I'm assuming you don't want to use a multi-value parameter here, you only want users to run against all builds or just one, not a selection of builds. Otherwise you'd just use a standard multi-value parameter.
One way to do this is to return an extra row for all builds in your parameter dataset, e.g. something like:
select buildId as null, build = 'All'
union all
select buildId = build, build
from builds
I'm returning two columns here so we can pass a NULL value parameter but still have a user-friendly description to display in the report.
Set this up as your parameter dataset. In the report code you can then use the parameter to do something like:
select *
from builds
where (#build is null or #build = build)
Which will return all builds when #build is null and a specified build if #build is not null.
Would it be correct to simply change the where clause in the stored procedure to
Where [field] LIKE #variable
Then in SSRS under the Available Values have the "ALL" parameter value be % (the percent symbol) ?
Is there an error in logic here. It seems to have the desired result
The following picture shows the query and its result with no variables:
The next one shows the same query with a variable and a different result:
This how the parameter was set just before the query execution:
I have also tried setting the parameter without '' but it produces the same result.
Any clue about what's going on? Any help would be greatly appreciated.
NOTE: The DBMS is MySql
This weird issue is due to the fact that SSRS is connected to MySQL by ODBC connector; therefore, the query parameters should be defined as ? and their names are Parameter1, Parameter2, etc... in order of appearance
Source: http://www.tek-tips.com/viewthread.cfm?qid=1354185
In Report Builder 3.0 you can user parameters in a dataset query using the following syntax:
WHERE sql_column_name = (#Parameter_name_in_ReportBuilder)
Example:
SELECT * from [dbName].[dbo].[TableName]
WHERE Account=(#Parameter1)
Before you can run the report, you need to configure a paramter named Parameter1 (in this example, change this to the name of your parameter) in Dataset Properties - Parameters. The value field should be set to one of the parameters