We have a report in SSRS that has drop down list parameters that are fed by a shared datasource and query.
If I use ReportViewer to view the report these work as expected.
However, I'm also using the SSRS web service to pull out the parameters and the available values. In this instance when drop downs are moved from a manually entered list to a query the available values list is empty.
I'm assuming the problem is because the web services simply gropes the RDL file and does not execute the queries attached to the parameters.
My question is, is there any way to have it do this or to get the available values?
After reading MSDN it seems the answer is to call GetReportParameters() and set ForRendering to true:
If ForRendering has a value of false, the parameter meta data returned represents the parameter data that is currently associated with the specified report. If any parameters values are based on a query and you are interested in returning the query-based parameters valid values list, you need to set ForRendering to true, In addition, for query based parameters, you need to ensure that you have passed in all of the credential information required to return the query parameters.
Related
I'm using the new Report Builder for SSRS in SQL Server 2019, and I'm trying to create a paginated report with one multi-value parameter.
I've given my report two datasets, both from the same shared Data Source. One data set is all the report data, and the other just return as distinct list of keys from the first dataset.
Both queries run and return their expected values in the query designer. However if I create a multivalue parameter and set the available values to a field in that query. I get a blank list every time, and the entire report is also blank, even though I don't have the report configured to do anything with that parameter yet.
What am I missing? I am using the same cached sql login on the report, data source, and datasets, and the query definitely returns values.
If I remove the parameter from the report, then everything works as expected.
I'm seeing some weird behavior I can't quite figure out. I have a report with a bunch of parameters, none of them are cascading. A handful of the parameters are set to allow multi-select and the available/default values are retrieved from data sets that used stored procedures.
When I load a report every data set executes, which I expect. However, if I change a parameter value, such as the date for the date parameter, every data set executes again. Why is this?
What's compounding the situation is I have 2 copies of each parameter (Param1, Param1_Internal, Param2, Param2_Internal, etc.). I have it setup like that for formula's I'm using in the report to determine if the user selected 'Select All' for the multi-select parameters. So for example I'll have Param1 and Param1_Internal set from data set 1, Param2 and Param2_Internal set from data set 2. When I change an unrelated parameter data set 1 will execute twice, and then data set 2 executes twice.
Any suggestions to:
Get these data sets to run once each, even though one data set feeds available values for 2 parameters?
Stop the data sets from running every time I change an unrelated parameter?
I am currently on SQL Server 2016.
Thanks
Edit
So, I found the answer to part of my question. In some cases I am using an expression as the parameter value in the data set that calls my stored procedure. It looks like when you do this, SSRS will execute that data set every time you change any parameter value. I still am hoping someone will have advice on how to have a dataset run once in a situation where I have 2 parameters using it for default/available values.
You can cache data set results if they are in a shared dataset stored on the SSRS server. This way the first time you run it will execute the query, then the second will just pull from the cache:
https://learn.microsoft.com/en-us/sql/reporting-services/work-with-shared-datasets-web-portal#caching
Use with caution though, as if the backing values of your parameters change often you could get inconsistent results with your reporting.
You can stop the refresh on parameter change by making sure the below is set within the parameter properties:
I set several parameters for a report created in SSDT (SQL Server Data Tools).
How can I run the report on all available parameter value and form a comprehensive
report with each case per session?
Thanks a lot.
E.g. a report called 'data growth' with parameters #database and #tablename. A serial of available names for these two parameters. I would like to compile the report with all cases.
You have two options.
1.
Manually include an additional All option into your parameter selections, either by adding a value in the menus or unioning the value if your parameter options are data driven, and set the source query to return all results when selected.
2.
Change your parameter to a multi-value parameter and change your source query to use where database in(#database) which will enable all combinations of your parameter to be selected, including all.
Currently we create Jasper PDF Reports from a single simple database table for our customers. This has been achieved programmatically. It's static. If the user wishes to change the query, he/she creates a change request, which we cannot deliver before the end of the next sprint (SCRUM).
The tool/library should be straight forward (e.g. convention over configuration) and employable from within a JavaEE container. And, open source.
Is there a dynamic tool that allows or customers to create the simple queries/reports themselves without knowing SQL? Means, they should be able to see the table and then create a query from it, execute and print (we could use Jasper Reports for the last one).
E.g. Select only data from year 2014, aggregate them by customer group and select columns x,y and z.
All of these criterias and query structure may change though, thus not just the value like year 2014.
Questions:
1) Is there a tool that presents the data in some kind of SAP-cube or something similar where the user could select the structure and attributes?
2) Can that tool save template queries (queries that the user has invoked before)?
thanks
With BIRT you could use parameters in the report... for example have one report that shows the whole data set or data cube (or at least a bit of all of the fields). Then you could add JavaScript to the report (or do all of the presentation in JavaScript for that matter), that shows the parameters a user can select from. These parameter values can then either be sent to a new report or could update the existing report. Parameters can be put into database queries too.
If that was exposed in JavaScript on a web page you could save the parameter values to an array and store them in the browser or server.
I have a stored proc in sql-server and one of the parameters it returns is a string with the query parameters. I display those query parameters at the top of the report. That works great if something is found, not so great if nothing was found.
We have tried returning two query results, one the data set that I will make the report from (which includes the query parameters), the other the query parameter string. Crystal appears to only see the first data set, and this very old discussion (http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=42462) says that is not something that will work. But that was over 5 years ago, and I'm hoping things have changed.
The problem, is if nothing is returned, the report is so blank that the person doesn't even know what query parameters they used. If they could see that they queried something that doesn't return any results, that would be useful.
So, if I have at the end of my stored proc:
SELECT * FROM [#ResultSet]
select #SearchCriteria as SearchCriteria
I'd like to be able to display the SearchCriteria even if there is nothing in the #ResultSet. Can it be done with this version of Crystal? Is there another way to do this?
Unless as stated by the first answer the results of one procedure have the same number of columns of another procedure (this includes type), if this is the case you can UNION the results or UNION ALL the results (if you want duplicates) to get ONE resultant set.
If the types or columns are not the same then you cannot do this. The only other option you can do is to merge all the relevant data into a temp table and then return the results from that temp table (SELECT * FROM #temp)
How are you currently able to display the parameters when results are found?
You haven't mentioned how you are using the Crystal Report in your environment.
Typically, I've done criteria display by passing the parameters to the Crystal Report as Report Parameters, and then using them in fields. This assumes you are calling it from a client application in some way.
Another option is to load the results into client datatables and binding to that as a datasource, it's certainly possible to handle the multiple result sets that way.