I have to set up a report where the user can choose a name from a drop down list. Is it possible to set a default name from the drop down list? So when the report's delivered to the user's email address, the results should be displayed of the default name's results. Is this possible?
I have tried a method to setup a default value but I am not sure if I am doing it correctly. What I did was, Open up Report Parameters and under default values, I selected Non-Queried and entered the Name which I wanted to display, but that did not work
If I am unclear, ask me and I will try my best to explain.
Thank You
you are talking about a report being delivered to the user's email, so i suppose you have a subscription set up. if so, you can set the parameter value in the subscription. you will need one subscription per user, and set the parameter in each subscription.
if you want to automate this (have the parameter set depending on the recipient), one option is to use data driven subscriptions (sql enterprise edition).
Related
Is it possible in SSRS to set a default parameter value for a report subscription only, but not set a default when the report is run manually?
I have the default dates I want to use for the subscription generated in a dataset, but I'd like to only use default dates for the subscription.
Here is one idea.
Select the target report and click manage.
Select Create Linked Report and Rename it to denote Subscription
Set the desired parameters for subscriptions on the new linked report.
NOTE : Parameters can be set independently for linked reports.
Point your subscriptions to the linked report.
NOTE : If you modify the original report the changes will show up in all linked reports as well.
I was able to resolve the issue by using data-driven subscription and creating a query inside the subscription to generate default parameters
I have an SSRS (2016) report that accepts a date parameter. The user selects a date and the report runs and returns one page per customer. The report also has a data driven subscription which when triggered, emails the output relevant to the customer.
My current approach is to have a text box that only some users can see and clicking the text box triggers the subscription . I do this by :
Inserting the parameter selected by the user into a table when the user clicks "View Report" button and then use the following to trigger the subscription:
EXEC msdb.dbo.sp_start_job #job_name ='job name to be sent out'
The data set for the subscription/ report then uses the parameter inserted into the table to do it's thing. This all works fine.
The problem arises when more than one person runs the report.. the second persons trigger can potentially over write the first persons parameter insert resulting in the wrong set of data being sent out..
My questions is.. is there a better way to trigger data driven subscriptions where the report needs parameter values - but the parameter value cannot be predetermined?
If my approach is acceptable, how can I eliminate the overwriting of parameter values?
Better still, how can I determine the correct parameter and pass it to the subscription? e.g. session id / user id.. etc.,
Any ideas or alternate implementations are welcome..
I've run into the same issue before, where a default table value is overwritten during processing from another user. The way I resolved it was adding a column to the default table for the HOST_ID or HOST_NAME. It's a bit of a pain because then you have pass that parameter to the report as well.
SELECT HOST_ID(), HOST_NAME()
OR
In a report parameter you can use the following expression default value to get the current user.
=Right(User!UserID, Len(User!UserID)-instr(User!UserID, "\"))
Note: Your data-driven subscription will fail if you set this as a report variable. As a parameter, it will work.
First I would like to apologise for any mistake and misuse of the english language as it is not my natural language.
I built a few reports using SSRS. Each one are feeded through different stored procedures.
Each stored procedures has two parameters: id and date. When I display the report the parameter I only want to be visible the date that will be supplied by the user. The id should be hidden and with the default value of 1. So, I turned the parameter id to hidden and set up a default value with the value 1. Im setting the default value on a report's definition level instead on the datasets used to feed the reports. PLease see below the steps I have done:
enter image description here
enter image description here
I've been through some websites(stackoverflow included) and I've seen similar issues. I followed the suggested tips but still no success.
Any help on this will be very appreciated.
Thanks
P.S. Im using VS2015 to design the reports and SQl Server 2014.
Without knowing more, my first instinct suggests that you have your parameters ordered incorrectly. If you have a parameter, P2, with a default value that is processed after a parameter without a default value, P1, and both parameters are hidden, then the report will fail citing that P1 is missing a value.
See my screenshot below as an example. You need to make sure that the parameters are loaded in the order, vertically, that they should be processed, especially if one parameter is dependent on another. Take a look at the ordering and leave a comment if you need further information.
Revised based on Response in Commments
Try opening the report manager via the Report Server web interface (http://[serverName]/[instanceName - reports is default]/Pages/Folder.aspx?ItemPath=/[directoryOfReport]). Click on the dropdown list beside the report name and choose manage. Check out the parameters tab and make sure the default is set properly. Sometimes, if you've messed with parameter properties numerous times in BIDS or report builder, the settings won't translate onto the server itself. Let me know if that fixes it.
We have a SSRS report which has about 12 parameters. It works fine in native webpage mode. We can input/select values for the parameters, and run report successfully. However, when user setup report subscription, there are only four parameters were populated with values, the others are blank.
Is there a maximum limit settings in report server, to control how many parameter can be used in subscription?
I just created a report with 20 text parameters and a subscription with hard-coded values for all 20 and it ran perfectly. In terms of production-quality reports, I have some that have up to 25 parameters, although I've never run them via a subscription.
In terms of what your user experienced, I would recommend checking your parameter default values to see if they allow blanks or default to blanks. If the parameters are internal and they allow or default to null or blank and are internal, then they will yield blanks in the subscription.
If your parameters are internal, then the user cannot specify a value via a subscription. If the parameter is hidden, then I believe a default value is necessary and the user will be prompted with an option to change the default value.
After a quick google search, I couldn't find an answer to your question. I suspect there is more of a practical limit to the number of parameters you can use than there is a hard limit.
See this article on MSDN for more information on internal versus hidden parameters. Perhaps this can be helpful for you in terms of minimizing parameters that are configurable.
I suspect the answer is no, but here goes..
I'm using the WebForms Report Viewer on a public-facing website to allow users to report on themselves or their users (if the user is an admin user).
A report has a parameter called Users where an admin can pick a user from the list and generate a report from it. Mundane users can also view this report, but I programmatically create a linked report for each user and set the UserID value to their ID so they can only view themselves.
This works well except that the UserID parameter is query-based, and not every user is visible in the list using default settings (the user list is based off date range parameters can provide, and only users we consider 'active' during the date range are visible).
This is blowing up for mundane users that are not active for the default date range (which is the previous month).
I suspect the flow of execution is something like this:
Report loads with default parameters
The linked report rules are now applied and the value of the UserID is overridden with the ID in the linked report
UserID field is now hidden to prevent the user from changing it
SSRS can't find the UserID default value in the query results (that I didn't even want it to run) so it displays an error The 'UserID' parameter is missing a value
Through some testing I've found a perfect correlation between users not inside the default date range and users who can't view the report.
Can anyone suggest a way to make the report usable for those users that aren't in the default list? The reports are created programmatically so I do have a fair bit of control over the situation.
I would love to simply be able to mark a parameter in a linked report as no longer being query-based, but those properties are all read-only.
I really, really don't want to have to create duplicate reports to accommodate these users but I'm at a bit of a loss right now.
Any suggestions are greatly appreciated!
Go into parameter section of linked report.
Disable 'Has Default'
Click 'Apply'
Re-enable 'Has Default'
Click 'Apply'
and you're good to go!
I haven't figured out yet how to re-enable 'Query Based' as a default after removing it :(
Would be very much obliged had you found out......
Can't you just mark the param as 'nullable' then pass null in from the linked report ( you may have to alter the back end to cope with this?
Alternatively add an extra row to the 'users' day something like -1 "unknown user" then you can just watch for -1 and handle accordingly