I have a program with multiple cascading parameters. I’m puzzled why, if they’re all set up the same way (Available Values, Default Values, Refresh), they don’t display the same way. In the images you can see that Job Type, Program Type, and Program Name all show the default ‘All selected’. But Job Name is empty. If I click on the down arrow, the values are all there and selected. (see second image). Is there any way to fix this?
i think, in your Job Name collection.. there is some blank/empty record. the solution could be either you restrict those values or in parameter select option "Allow Blank Value"...
All the best!
From memory this can happen if the query that populates the available or default parameter values includes a NULL in the result set.
Because your dropdown list has so many label values in it, the concatenation of those labels is violating the maximum size allowable by that SSRS control. This is why the text "disappears" from the dropdown box when choosing (Select All). I have been unable to determine the exact character limit of this. If you want to spend some time confirming this, it's possible to begin with (Select All) and begin unchecking items until you see the text reappear in the box.
Because this limit is not configurable, one possible course of action to solve this would be to, on the query that populates that list of parameters, truncate those values down to a small number of characters so that when they're concatenated, that limit is not violated.
This could mean that you have Values set but do not have Labels set for the available values of the Job Name parameter. Go to the parameter properties and select "Available Values". If "Specify Values" is selected, then you need to enter Labels for each Value. If "Get values from a query" is selected, then you just need to select a Label field from the drop down.
Related
I have a SSRS report in which i have a parameter which comes in a dropdown it is a multiselect parameter, now i want that at most user should be able to select only two values from the dropdown.
Although you can't stop the user from selecting more than two values, you can keep the report from being shown if they do. First, I created a red-text textbox at the top of my report that holds an error message. Something like:
You selected more than two values for ReportParameter1, try again...
Then, I set the visibility of this message with an expression (for hidden) set to =(Parameters!ReportParameter1.Count<=2). Now this error will show only when the user has selected more than two parameters.
I then hide the content of my report with a visibility expression of =(Parameters!ReportParameter1.Count>2). Note that you can simply put all your content in a rectangle and then hide the rectangle.
If your user selects more than two parameters, only the red error message is shown. If they select two or less, everything looks normal. I would also write your stored procedure in a way so that if a user selects too many values for the parameter, it won't return any data.
This is not possible. A multi-select parameter is that and just that: a parameter that lets you select multiple values.
If you will always only have two values that need selecting, the easiest way of implementing this would be to have two single value parameters labelled as Value 1 and Value 2 which are then both referenced in your report query.
There are workarounds as suggested by #Kyle Williamson in his answer, but there is no exact answer possible as this facility is not present in SSRS
On my report I have two parameters.
One is for the selection of an order number from a list (dropdown list) and the other is for typing an order number. The idea is to have the end-user either select the order number or type it, not both...
Is there a way I could empty the textbox when a list item was selected and vice versa, i.e. selecting an empty value from the dropdown list once an order number has been typed? I thought about using code but it would be impossible to determine which of the two parameters to use once the "view report" button has been pressed.
Any other approaches to this situation are very welcome.
Thanks in advance for any replies.
Define the parameters
Let's assume the first parameter that allows the user to enter the order number is called typed_value and the second parameter that allows the user to select an item from the list is called list_value.
Prevent list from being used if value is typed in
Add the following to the where clause of the query that populates the list_value
WHERE #typed_value IS NULL
This will prevent any records from being returned when the typed_value is not NULL, blocking the customer from selecting an order from the list if they have already typed in an order.
Update list_value with typed_value
The above code will only remove the list items, but to get the list to populate with the typed value add this union to the query that populates the list_value
UNION SELECT #typed_value WHERE #typed_value IS NOT NULL
If the user leaves the typed_value NULL then they can select any value from the list_value. If the user types in a value, the list will automatically be replaced with their typed_value.
Which value to use?
You can power your report filter off of the list_value and ignore the typed_value because if the user enters any value in typed_value, the list_value will be updated to the typed_value.
Smooth out the UX
Make sure the parameter typed_value allows null value. It may be a good idea to set the default value of typed_value to NULL so that the user can see the list values when the report first loads.
Also setting the default value of the list_value to #typed_value will automatically set the list_value to whatever value a customer types in.
I have a form linked to a table. The form has 4 text boxes: one linked to the autonumber field, and the other three to text fields.
There is also a subform, from which I wish to launch a query (via button and macro) combining results from the subform and a control on the main form. When I specify any of the three text-based controls in a parameter query, this works fine, but asking for the value of the first (autonumber) control results in a symbol being displayed instead of a value.
I wasn't sure what specific information/images would be helpful. Please ask for specific information if you feel it would help.
I've been given the answer elsewhere. I had to implicitly convert the results of the batch field into an int.
INSERT INTO heat_treat_jobs ( card_id, batch ) SELECT atheattreat.id, CInt([Forms]![heat_treat_loads]![batch]) AS Expr1 FROM atheattreat WHERE (((atheattreat.index)=[Forms]![heat_treat_loads]![atheattreat subform].[Form]![index]));
I have a report in SSRS and one of the parameters I use is Cities. The user can select from a list of cities to pull the report for that location, or multiple locations. My datset is simply a select * from tblCities. When I run the report, I do see that one of the options is "Select All." But, I'm wondering - is there a way I can get this "Select All" option as the default value, so that by default all cities are selected?
And, along those lines, but a separate question - is it possible to make this drop-down optional? I have tried the allow NULLS checkbox, but for multi-value parameters, it seems SSRS does not allow this.
FYI - I have only begun using SSRS; know very little about it.
is there a way I can get this "Select All" option as the default value, so that by default all cities are selected?
Yes you can.
Open the Report Parameters dialog: Layout tab, right click anywhere on the canvas that is not the report, select Report Parameters
Select the parameter (cities in this case), from the list on the left
Select the appropriate default setting in the default section, lower righthand corner
One option is where you can statically define a value. IE: =0 or whatever the value is for the Select All option. FYI: I've found that what works in the Visual Studio preview doesn't work when live.
Another option is if the list of cities comes from a stored proc, you order the output of the sproc so Select All is at the top of the list. Then you select the radio button under the static value one (can't remember, not at work to check ATM) - you'll have to select the dataset the sproc is associated with, then the column that the value comes from.
is it possible to make this drop-down optional?
When you say "multi-value", are you actually able to select multiple values from the list? IME, all you get is a drop down & can only select one of the options available.
Allowing null is just an accepted value - the optionality is really handled in the query so that if a sentinel value is provided then the criteria isn't included in the query. IE:
AND (#cities IS NULL OR t.city = #cities)
That's quick & literally dirty. ORs are poor performance.
Make these changes to the specified report parameter:
In order to have all fields selected, make the [dataset] and [valuefield] at "Available values:" equal to the [dataset] and [valuefield] at "Default Values" (assuming you have a query for determing this)
In reports when we want to default the multivalue parameter to 'Select All' following are the steps.
Open the Report parameter window from the Report menu.
Select the Report parameter from the left handside of the window.
Select 'Multi-value' checkbox and appropriate 'Available values'.
Under default values select 'From Query' radio button'.
Select the appropriate 'Dataset'.
Select appropriate 'Value Field'.
Save the Report and select Preview Tab. You will find all the items selected in the multivalue parameter list and the result displayed for all the selected items.
Go to the either the Data tab or the
Layout tab.
From the Report menu, select Report
Parameters
Select the desired parameters, in
this example, cities
In the lower right hand region of the
screen, set the Default values radio
button.
Set the Dataset and Value field drop
down lists to the exact same options
as the DataSet and Value field sections from the Available Values settings above.
This assumes that you are using the "From Query" option under "Available values" If you are using the "Non-queried", see the answer by OMG Ponies.
This should probably be pretty simple but my Google-Fu is as yet unable to find an answer. I simply want to create a dropdown list in Access so that upon selection I can perform some action based on the value of the selection. For instance, I have a list of people and I would like to populate the combo box so that their names appear in the list but the "value" is set to their ID (the primary key).
It sounds like you might be asking how to display something in the dropdown other than the ID while keeping the ID as the returned data from the dropdown. If that's the case set the Bound Column to the ID field (usually 1) and (assuming the name field is next) set the Column Count to be 2 and the Column Widths to be 0";1" or 0";[whatever width you need].
You will need to hook into the onchange event for the dropdown list.
and from MSDN
How have you set the properties for your combo box?
Perhaps you could try setting (assuming you are pulling data from Table1 with fields ID and Field1
Row Source: SELECT [Table1].[ID], [Table1].[Field1] FROM Table1;
Row Source Type: Table/Query
Bound Column: 1
Column Count: 2
Column Widths: 0", 1"
and then hook into the onchange event as Chris Ballance suggests. The value property of the combo box is ID; the text will be what is in Field1.
OK, I figured it out even though it was a bit counter-intuitive. An Access Combobox can have as many values as you want (instead of just one key on value). By default all of the values are are shown in the list so you need to hide certain columns by setting their widths to 0. That is done via the ColumnsWidths property in the property pane. ColumnWidths takes a comma separated list of values which corresponds to the order of the columns in the list. I hope this helps someone.