Conditional report parameters in Reporting Services - sql-server

I have a report which requests a parameter value for customerNo. The report should return all values by default.
Once the user provides a single customerNo value, then it should display the specified record only.
I've found solutions for Multiple selection, but couldn't find for single text box entry.
Thanks guys..

Report Design
Change the report parameter to allow NULL:
Modify the WHERE clause of the data set to check NULL parameter value:
Report Execution
When the report is run, users can check NULL for all rows:
Or rows matching a specific value:

Related

SSRS Optional parameter

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?

How to display a multi-valued parameter onto a SSRS report in a specific way, separated in ranges and/or commas

In SSRS I need to display a multi-valued parameter onto the report in such a way that if values are chosen in sequence they appear as: 1-5, 7, 9-10, 15 and so on. And I have the following values in my drop down list of values: from '0' to '200'.
Thanks in advance for your help.
This is what I have done in SQL so far, so I am thinking to update 'String_To_Use' column so it would display: 0000-1020, 1199-1210, 1260, 1299. Then use this string to display onto the SSRS report. These are the values chosen in SSRS from the drop down box. I don't know yet how I would pass these values to the SQL code yet. Please help with this part as well.
This is the #tempTable1...column 'DPRTMNT' has the values chosen ...Checking_Dept has the value-2 when values in ranges
This is the #tempTable2..I need to update 'String_To_Use' column so it would contain: 0000-1020, 1199-1210, 1260, 1299. #tempTable1 can help to build the logic
replace dsBranchPlant with name of your data set that your using to supply data parameter. And "All" condition is if all params are choosen instead of showing each one. Game this up as an expression and see where you stand.
iif(Parameters!BranchPlant.Count = CountRows("dsBranchPlant"),"ALL",Join(Parameters!BranchPlant.Label,","))

Printing records with condition Crystal reports

I am using stored procedure in mssql as backend, vb.net as frontend (just info).
There are a lot of records in the database and I am printing in crystal reports.
Now I want to filter the records from crystal report and not by adding a new parameter to procedure or changing database structure or else.
For now,Say there are columns : Name , Amount.
I want to put filter in amount like only display records whose amount above 100 or something. So other records with less than 100 should not be displayed.
This filter will be passed by the user so it'll be random.
I can't find a proper answer on internet. Might be a duplicate question, if so please post the link of the question if it is duplicated.!
Thanx anyways...!
In general the idea is to:
Create the parameter (user choose what will be the input/value) - link
Set filters, what values should be displayed in regards to parameter - link
On right side there is a DataExplorer window, where You need to add a Parameter (define his name, what question will be shown to user and what type the param will be / what values can be set inside).
Once done, You can jump to Data tab of a report, click Interactive Filter and specify which column must fit what condition with what value = Parameter (that one user will enter in Report).
Example: I will create AmountParam, with message "What should be the minimum amount?". Type will be set to Integer. Going to Report->Data->Interactive Filter, choose Amount as a Column, AmountParam as a Parameter and set condition Greater then (>).

SSRS 2012 - Pass list of values to multi-select parameter in linked report

I have an SSRS report (report A) that currently generates a comma-delimited list of user ids based on a labor category. I'm trying to link report A to another report (report B), and pass that list of user ids (contained in a single field), to report B to use in its multi-select parameter 'User Id'.
The field value being passed from A to B is "1,2,3,4", etc., but when report B loads, the parameter drop down shows no value selected.
Is there a specific format the string needs to be in for the multi-select parameter to pick it up?
I've tried splitting the field, then using the JOIN() command, but no luck.
Thanks!
CodeGrue's answer to a similar question gives a solution for passing multi-valued integer parameters:
Passing multiple values for a single parameter in Reporting Services

how to set SSRS Report parameters to be optional i.e Non-Mandatory field in SSRS 2005

Please help me to set the SSRS Report parameters to be optional i.e Non-Mandatory field in SSRS 2005.
Set the parameter to 'Allow null value' under General section. Null according to SSRS means it does not have to be set, thus making it optional.
Then post something like this in the predicate of your SQL syntax:
Where column = isnull(#Variable, column)
This lets the dataset know that if the variable is set then use it, else have an operator to have the value equal itself. I am certain this works in SSRS 2008 and 2012, not sure of 2005 but I would assume it may be there.
As Hiten suggested there is nothing exactly we can call as optional parameters but if you want users to see this parameter as optional, use formula or case statements.
Parameterized stored procedures with some defaults or null value can be used to achieve the same goal.
Further to djangojazz (dig the name, btw) - If the dataset is based on a SharePoint list (which doesn't support Query parameters, afaik), you can use the following formula in the Value box of the Filters section of the Properties dialog in whichever data region (e.g. Tablix) is invoking the parameter:
=IIf(IsNothing(Parameters!myParam.Value),Fields!myField.Value,Parameters!myParam.Value)
Neither of these answers helped, nevertheless I found the solution here:
Open the report for editing in Visual Studio.
Expand the Parameters node and rename the affected parameter to ParameterName1.
Set AllowBlank and Nullable to True if not already set.
Deploy the report.
Rename the parameter back to ParameterName.
Deploy the report.
After adding a parameter to your report and checking 'Allow Null Value',you can then add a filter to the dataset where the below expression is added to the value field for the filter
=IIf(IsNothing(Parameters!Param.Value),Fields!Field.Value,Parameters!Param.Value)

Resources