The issue:
I'm working on a SSRS report, but have encountered some quite strange behavior when I populate a DropDown (another paramter, named "Group") using a DataSet that uses another parameter that is passed in through the URL.
The problem is that I want the Group-parameter to be updated from the URL parameter TrackerTypeID, which works absolutely fine in other cases. Though this is the first time I have a parameter depending on another parameter in its DataSet.
However if I have TrackerTypeID as a visible parameter and manually change the integer value of the parameter the DropDown parameter (Group) is updated accordingly.
What I've done:
So I have a hidden parameter that is passed in through the URL called TrackerTypeID. This parameter is then used in the where-clause of the DataSet that populates another parameter:
SELECT
ID,
TrackerGroupDescription
FROM
vw_TRK_TrackerGroup_LK
WHERE
TrackerTypeID = #TrackerTypeID
Union SELECT Null, '-- Select All --'
As you may suspect it uses the Available Values in Parameter properties to set the available values from a query.
What I expect to happen:
As you might have already suspected I wish for the DropDown parameter to be
Related
I'm not seeing another thread that quite encompasses my scenario: the report I'm modifying has a parameter that I want to make optional, but it is comprised of 3 fields. There is a first name and last name field in which you can start typing, and with the use of a LIKE operator, the actual parameter (Authority) used in the main data pull populates with options that match:
So I've attempted ensuring that the parameters (all 3) have the 'allow blank' and 'allow NULL' checkboxes marked. I've also modified that parameter within the dataset properties to account for NULL:
Lastly, my main query's WHERE clause has the following line: and (data.AuthorityName = #Authority or #Authority is null)
When I declare this variable and set it to NULL, the query does exactly what I want it to, it pulls the data irrespective of what's in this column. But for some reason, I cannot get the report to pull anything. I click View Report and nothing happens. Any ideas?
I had similar question for sub report and was answered:
SSRS passing multiple string parameter to another report
However this time I would like to pass my parameters to a different report instead of a sub report.
For the first report, my ponum parameter consist of string like 'a-01', 'b-02', 'c-44'...
and then perform a query that like
select column_X from table_1 where ponum in (#ponum)
and then user click on a expression link which send the rows to another report to perform another action via a query. such as
update table_1 set column_A = '123' where ponum in (#ponum)
My problem is I can't send the parameter as a multiple values parameter. I added an expression for user to click and added the parameter in this window
I also tried
=join(Parameters!ponum.Value,", ")
="'"+join(Parameters!ponum.Value,"', '")+"'"
In Report_2, I set up the parameter as this
Unfortunately, the report it goes to only receive the first value or the query doesn't work and parameter being the problem.
Would like to hear any idea that might work.
Thanks in advance.
I am using a split_string delimiter to be able to choose from multiple values from the SSRS report. I am able to select Multi Values in the SSRS report but the SSRS displays #Error where the multi value should be.
Picture for reference
This is what my expression for the report looks like
The count and ismultivalue in the expression works just fine
For Example:
I am using isMultiValue in the expression and it works fine
but Label and value throws #Error
In your report expression you are referecing the Parameter rather than the value that is passed to your Dataset, so successfully using a string_split function in the Dataset is actually unrelated here.
This is because multi valued parameters are Objects and not simple scalar values. When you do a count on the Parameter you are counting the items in the Object, which is a valid operation.
However, the Parameter object can't show you a single Value or a Label as it doesn't know which Value or Label to show you, even if there is only one item in the Parameter object.
What you need to do instead, is use a zero based Index value to specify which item you want to display:
="Bkt: " & Parameters!BKT.Label(0)
or tell SSRS to display all the items within the Parameter object as a list:
="Bkt: " & join(Parameters!BKT.Label,", ")
I'm working in report builder, calling a stored procedure that has a parameter that, when null, sets itself to a certain value. I want to display what this parameter is set to on the report. From experimenting, Report Builder's parameter collection only shows the parameter as it is sent from the report.
Alternatives that I've considered but can't get to work or are sub-optimal:
Adding the parameter to the select statement. The main drawback is this won't display a value if there are no results.
Using a return value or output parameter. There doesn't seem to be a way to do this.
Re-creating the "null" logic in the stored procedure. The correct output is displayed but this is a code fork.
How can I display this value? Is there a way to show a return value or output value?
You could change the procedure to return the parameter value in a UNION ALL select so that a row with the parameter value will always be returned. That row could have NULL for all the other columns so that you can filter it out in the rest of the report.
Another possibility is to add a second dataset to the report that does nothing but get the value of the parameter based on what you pass. That, however, is also a sort of code fork. The fork could be mitigated, however, by putting it in a UDF, and resourcing the same UDF in both datasets.
Yet another possibility is to replicate the logic of populating the parameter in a Custom Code block in the report. However, that is also a code fork.
I've never worked in Report Builder interface but I do have quite a bit of experience building reports in BIDS/VS... There it's a simple matter of setting the parameter default, in the rdl, to match the default in the stored procedure.
I have a report connected to BI cube. In the report there is a parameter with the datasat from the cube as well. This parameter correctly appears as a multi-select drown down in the report viewer, and the values are correctly populated.
However, when I am calling the report using javascript and passing the report parameters as a post request, there is an interesting behaviour.
If in the parameter, I pass a value that is not included in the list, the report crashes with the following error:
Default value or value provided for the report parameter 'Name' is not a valid value. (rsInvalidReportParameter)
Is there a way to make SSRS simply skip the invalid values rather than throw an error?
Without knowing more on what is 'acceptable' for the parameter value this question is nearly impossible to answer. In SSRS the first level of acceptance of a parameter is the type which is the common 'text' (string of equivalent in code), integer or DateTime. If you are passing a parameter to the report NOT in the format it wants it will bomb. That should be as designed.
If you limit your scope of 'available' values of a parameter by attaching the parameter to a dataset stating: "Get values from Dataset". If you give the parameter a value NOT in this collection it will also bomb. This would be the argument equivalent of selecting 6 when your choices are 1-5. And getting the standard .NET equivalent of 'argument is outside the bounds of the array.' That is also by design.
For debugging I would suggest trying to set the value in SSRS as the 'default' statically and if it can accept it then the issue is in the transfer and the type. If you can and then cannot from the web pass in via javascript or whatever method you choose it is the type being passed in. In such cases I have passed in a string and then transferred it's type in SSRS dynamically with a cast.