SSRS refresh default value for parameter with no defined available values - reporting-services

I am creating a report in SSRS which displays information about properties in a county. The user can select a district for which to view properties. Some districts are small, having only 10 properties, others are large with close to 8000 properties. For the large properties, the System.OutOfMemory exception gets thrown when trying to run the report. To work around this, I added 2 parameters where the users can specify the range of properties to look at (1-500, 7-2231, etc). The default values for these parameters are 1 and the count of properties, so that all properties are reported by default.
The problem I'm having is that after you select a district and the parameters are populated based on that district, if you then change your district, the default values don't change. So if the first district you select has only 10 properties and the second one has 500, you'll only see the first 10 in the second district. I've done some research to see if it's possible to refresh the default, but all the solutions I've seen are using dropdown parameters, which is impractical for what I'm doing. Is it possible to refresh the default values of a non-dropdown parameter?

I don't think this is possible in the way you're asking for. A workaround would be to give the user a parameter to choose between "use defaults" and "use entered values", and then don't put defaults in the other parameters. If the users understand what they'll get if they use defaults, this will work the same way, though it's a bit more confusing.
In your dataset, you'd have to have an OR or CASE that tested the value of the #default parameter to determine whether to use entered parameters or defaults.

Related

I have 3 parameters and I keep getting the forward dependencies are not valid error

The report parameter 'ServicePriorityNameParameter' has a DefaultValue
or a ValidValue that depends on the report parameter
"ServicePriorityNameParameter". Forward dependencies are not valid.
This is the error I keep receiving when trying to use this parameter.
I also have a WorkCategoryParameter which I specified the values for. Also a RequestNumberParameter in which a request number can be typed into.
I have tried reordering my parameters and also adding a separate dataset in which to run each parameter off of. I'm pretty new to SSRS so any words of advice will help. Thanks!
Reordering the parameters in the designer does not actually reorder them. If you open the report's rdl file (if using visual studio just right-click the report in the solution explorer and select View Code). In there, look for the ReportParameters section and reorder the parameters from there. Basically you need to make sure that any parameters that are dependent on other parameters are listed after the thing they are dependant on.
E.g. If you had a parameter called #Countries to list countries based on continent and the dataset that supplied the values to that parameter read something like SELECT * FROM dbo.MyCountryTable WHERE Continent = #continent then the #continent parameter would have to appear first in the list as #Countries depends on it.

How to create a custom SSRS user warning?

I have a report that can be VERY expansive - potentially returning hundreds of thousands of rows and taking 15+ minutes to render. The users have four inputs including two dates indicating the report range and two filters that default to (All). What I'd like to do is throw up a warning to the user if they try to run the report without selecting a single entity from either of the two filters, or if the user attempts to bring up more than one week's worth of data at a time.
Is there any kind of checking I can do at runtime in the report (short of coding it in the procedure) to warn the user that they are about to get more data than they can handle?
I would add a Hidden Parameter e.g. Accept_Run_Time_Warnings, with Static values e.g. Yes or No. The Default value would be set by an expression, based on the prior Parameters and your criteria e.g. entities selected, date ranges etc. If those conditions are met, Default = No, otherwise Default = Yes.
Then I would add a textbox to the top of the report body with the warning text to show the users, finishing with something like "Click here to continue with these parameters". This textbox would be hidden if Accept_Run_Time_Warnings = Yes. This textbox would have an Action to run the same report, passing the same paramters, but with the Accept_Run_Time_Warnings = Yes.
I would hide all other report body tables charts etc if Accept_Run_Time_Warnings = No.
I would edit the parameters for the main datasets to test Accept_Run_Time_Warnings - if No then they can pass non-existent values (to speed the dataset execution), e.g.
=Iif ( Parameters!Accept_Run_Time_Warnings.Value = "No" , "DUMMMY" , Parameters!Customer.Value)
Thanks for the ideas. We decided instead to break the report into two reports and removed the "All" option from either one of the two selection drop-downs on each report. The titles on the individual reports give a clue to the user about which one to use and clue them into the need for a selection.

Hiding or disabling passed parameters in SSRS

I have a summary SSRS report that I allow the user to drill on. When they click to see details, it take them to a different report and passes the parameters from the first page with it.
My problem is that I have 4 possible parameters, but depending on what count the user clicks on, some parameters have values and some are blank. I do not want the users to have the ability to change the passed parameters. If I mark all of the parameters as 'Hidden' I get an error for the ones without values (The 'day' parameter is missing a value), even though I allow them to be blank or null. I've also tried just passing an empty string or 'Nothing' and I get the same error
Ideally, I'd like them to be hidden, but I'd also be okay with graying them out or disabling them. Passing them in the URL is not an option..

Parameter is missing a value ssrs 2008

I have a parameter of integer datatype which is hidden. When i run the report, report gives me an error
Parameter X is missing a value
However if i make the parameter visible it works. I tried providing default value of 0 but that does not suffice my requirement as i have sub-report(Drill-dowm) depended on this parameter. Please help. Thanks!
Make sure that you have not specified Available Values for the parameter. Available Values should be "None" for internal and hidden parameters.
First of all,
Check that parameter's - Available Values by going to report parameters properties.
It must not be specified any values. So we should set it as None
Second work around is,
Just add a blank space at Specify values - in Default values inside report parameters properties.
This will surely work. Hope it will save your time.
I had to do an "if exists" statement for this to go away. It worked for me because it makes it always return a value even if that value is not need by my query.
if exists (my select query)
my select query
else
select '2'
// '2' would never be used, but it made ssrs stop giving me
// the stupid error and execute the rest of the query
If you specify available values from query, then default values must be in list of available values. Default value in (Available) = true.
The problem occurs also, if you have a parameter that depends of another one without "default value" inside the Dataset Query and does not admit null value.
For example:
Parameter 1 have a default value: NameEmployee from the dataset "EmployeeSearch"
But the dataset "EmployeeSearch" have a filter or a parameter inside the query named #Month that indicate the number of the month. So if the value of #Month is null, SSRS will say "Parameter is missing a value".
Assuming you had the same issue as I had, trying to run the report on a web page using a ReportViewer component, I managed to fix that issue by adding a null parameter before rendering the report:
C# code:
var parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter("ParameterName", (string)null));
ReportViewer1.ServerReport.SetParameters(parameters);
Hope that will help
Just need to add 1 default value to get around this error (even though that default value will never be used).
-Under "Report Parameter Properties" for that specific parameter, go to the Default Values page.
-Toggle "Specify values"
-Add a value (I added: "just_a_filler_to_get_around_hidden_value_error" so when I look back at it later I remember why I did such a thing)
-click OK
I want to add to dmbreth's CORRECT answer.
I was missing the concept that the value of the parameter still needed to be tied to something. Originally, I was tying the output of a dataset by using the Available values portion of the parameter properties, but according to dmbreth's answer, that could not be the case. Finally I moved my output dependence settings from the Available Values section to the Default Values section and that did the trick.
So, in summary, in the parameter properties dialogue:
General Page - Allow multiple values checked(this option is specific to my application), parameter visibility set to internal
Available Values Page - None
Default Values Page - Get values from query, [appropriate dataset, value here]
Advanced Page - No significance here
Hopefully, that is clear enough to benefit someone else with the same problem...
I had a similar issue where the default value as set by SSRS is (Null), I didn't need the parameter for my report however; I found it useful for testing to filter down the list so I kept it, I guess I could have deleted it in SSRS on the dataset config. but I changed it to =System.DBNull.Value (I guess this could be any expression) instead and that worked for me, so then I can still pass in a value if need be and also set Available values (had to make sure a NULL value was added to my dataset) if I then decide to unhide at a later date.
There is one other potential here. I have had a situation where the report designer works but the server report object does not. The solution is to delete the server object and then re-save it from the designer.

How to reference in SSRS report (in client mode) objects from application

I have a report created in SSRS in client mode, which is run disconnected: I create the data source in code and pass to the report as a DataView. It works ok.
But I need to be able to reference from the project to some objects (variables, whatever) from my application, as follows:
I need some totals that are not calculated based on data in report. e.g. the reports show total sales in a period, with own total, but I need to display a field in report footer - previous month total (actually they are about 10 other "previous" totals).
I need to have some columns show / hide based on some settings in the application (e.g. I have application option : Show Previous month sales)
Any thoughts on how to do this?
Thank you
Q1-> In order to use data in your reports, you need to specify the data inside of a Datasource object. You cannot simply use the variables if that is what your intentions were. So yes, you are doing this the right way. *** Sorry, you could theoretically used Report Parameters for this.
Q2-> This is the real reason to use Report Parameters. You can pass parameters to the report to do exactly this. If the HideColumn parameter (for example) is set to true, you could hide all the columns that need to be hidden.
http://msdn.microsoft.com/en-us/library/ms251750%28VS.80%29.aspx
For question 1 - the data - the easiest approach would be to create a DataTable in memory and add it as another dataset OR to add fields for your original dataview that contain these values.
Question 2 - To hide or show the columns based on settings make the column visibility an expression based on the value of a parameter, in your code behind set the parameter value to your application setting.