How to reload report with same parameters in SSRS? - reporting-services

Scenario - I have a multi-value visible (user defined) parameter that I use in the dataset query, and I have a link in the report that directs the user to the same report (but it does something else that is irrelevant to this topic). However, when the report reloads, the user has to set the parameter again from the drop-down list.
Question - Is there a possibility to pass the parameter that the user already set the first time, and reload the report without forcing the user to set it again?
What I tried so far (with no success) - I tried passing the following parameter values to the report:
Parameters!param_name.Value(0)
param_name
[param_name]

The answer is - Yes, it's possible.
Have you tried - "=Parameters!param_name.Value" without "(0)" ?
Go to the Action tab of the Text Box Properties, select "Go to report" as Action, specify your current report as the destination report. And choose the parameters.
It works.

Related

How do I stop user from running a report if boolean parameter value is false/No?

How do I prevent user from running a report if boolean parameter value is false/No?
Or,
How do I disable the View Report button if boolean parameter value is false/No?
Scenario:
I am creating a new report say "Report 2" that works off data created by another report say "Report 1" run prior. As a check to remind the user to run Report 1, I have added a boolean parameter on Report 2 - "Have you executed Report 1?" that is dropdown list of Yes and No options with a default set to No.
I want to force the user to select Yes before executing the report, else display a message or just not load the report or keep View Report button disabled (thats not important, any option would do).
Can someone please give me some direction.
Thanks in advance.
There are a few ways you could do this....
Option 1: You could have a simple text parameter as you described, with two available options and the default as "No". You could then use that parameter in your dataset something like
IF #ConfirmParameter = "Yes"
BEGIN
SELECT * FROM MyTable -- Original query here
END
This would return no data to your dataset unless the drop down was set to Yes. You could then set the NoRowsMessage property in your reports tablix/table to "You need to run Report 1 first" for whatever you want.
Option 2: You could have a simple boolean parameter with no default. This would prevent the report from running until at least one option is taken, you could then something similar implement option 1 if the user still ran the report.
Option 3: Have a drop down with just a Yes option in but with no default.
Option 4: This final option may not be suitable depending on your scenario but if Report 1 always has to be run immediately before Report 2 then you could add a link (text box with "Go to Report" action) in Report 1 to run Report 2. This would only be visible once Report 1 has been run. Then change Report 2 to be hidden from the SSRS Web Portal/Report Manager so Report 2 cannot be easily run on its own.

Setting ShowParameterPrompts property when returning from a drill through report

In SSRS 2012, I have a Main Report that takes 1 parameter, a dropdown. I have a drill through report that is displayed from a Main Report. When the user is viewing the drill through report, I added a link on the drill through report that goes back to the main report. I use the same parameter value so that the main report is displayed before the drill through report was selected.
The main report displays correctly, but the paremeter area is hidden when the user comes back from the drill through.
I read that there is a ShowParameterPrompts property but I cannot find where to set it.
Is there anyway to set this property from the subreport so the parameter area is showing?
UPDATE
In the Action tab, make sure you select the Go to report option. If you specify the report this way rather than a URL, SSRS will use the appropriate report viewer controls.
You should see something like ...RSViewerPage.aspx?rv:RelativeReportUrl=... in your URL after you click on a drill-through.
The settigs should look like this:
EDIT:
Since this isn't working, let's try the URL method instead. Try this in a browser first to get the URL right and then specify it in the reports. To add the parameter in the URL after ".rdl" add "&rp%3a", then the name of the parameter, "=", and the value. So in your case:
= Globals!ReportFolder & "/SurveyResults.rdl&rp%3aSurveyName=" & <expr>
Of course the expression at the end there would be the value for the parameter. If your survey names have spaces, you'll need to URL encode them by replacing the spaces with "+" or "%20".

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..

SSRS Query Based Parameters Not Refreshing

I am having a problem getting query-based parameters to refresh in SSRS when the View Report or Refresh button is clicked. To illustrate the problem, I created a report with 2 parameters. 1 parameter is set to get the timestamp Now() using the SSRS function. The other parameter is set to get the value GETDATE() from a SQL Server database query. When I view the report, both parameters accurately get the timestamp. When I hit the View Report button or Refresh, neither parameter refreshes. The only way I can get the timestamps to refresh is to re-open the page up in a new browser. Is there anyway to get these timestamps to update without having to open a new page/session? Thanks!
Fix: Build a main report with no parameters. Embed a subreport to your report. In the subreport, build a parameter called RandomTime. In the main report, go to Subreport Properties and feed the parameter RandomTime with the Value =Now(). To properly refresh all of the query based parameters in the subreport everytime you hit refresh, they must depend on RandomTime. The easiest way I found to do this add a column to the SQL query like this SLECT #RandomTime AS DummyColumn. It ensures that the query will repull and all the parameters will refresh everytime the refresh button is clicked
Do this: Create a master report and add your report as a sub report. Make a dataset on the master that runs your sql query. Then, pass the result into the sub report parameter as an expression.
Example--- =First(Fields!YourValue.Value, "DataSet1") ---

SSRS Null Hidden Parameter in SharePoint Integrated Mode

I have a report (call it Report A) that was built using only the User!UserId to generate appropriate data for that person. This worked perfectly.
The feature was requested to be able to view other people's data through Report A, based upon security inside the underlying stored proc. I updated Report A to include a new parameter, EmployeeId, and created a new front screen report that has a "Go To Report" action, passing the EmployeeId. The Stored Proc takes both the UserId and EmployeeId, and returns the data for the requested employee, if the User has permission to see the data. This also works perfectly.
I set the EmployeeId parameter to be hidden, and a default value of null. This was to allow anyone who comes directly to Report A to be able to run for their data (no impersonation), as they are used to. Running from within BIDS, it works, but once I publish to SharePoint, I get:
"The report is missing a parameter value but prompting for it has been disabled."
I obviously don't want to prompt for the parameter, and value should be null in this case. Does SharePoint integrated mode not allow for hidden and null parameters?
In SSRS 2008 with Sharepoint, you need to prefix each parameter passed in the URL with "rp:". For example: URL.../RSViewerPage.aspx?rv:RelativeReportUrl=/TestReports/Orders.rdl&rs:Command=Render&rp:CLordID=1324381
From this MSDN page, it looks as though you may need to explicitly override the parameter value to set it to be null in the Manage Parameters dialog within the library/folder containing the report.