Power BI Report Server SSRS report parameters mysteriously changing - reporting-services

We are running Power BI Report Server Sept 2022.
I have a SSRS "Dashboard" report that uses multiple parameters to create "Go to URL" actions for various jumping points in my report.
#PowerBIReportServer is set to Default Value, Specify value of "/Reports/powerbi"
#SSRSReportServer is set to Default Value, Specify value of "/Reports/report"
Then I use these in other parameters like:
#PowerBIHelpReport is set to Default Value, Specify value of:
="javascript:void(window.open('" + Parameters!PowerBIReportServer.Value + "/General%20Reporting%20Help" + "','_blank'))"
Then I have a help button that has the Action\Go to URL set to [#PowerBIHelpReport].
When I preview the report on my developer PC I correctly see that #PowerBIHelpReport:
javascript:void(window.open('/Reports/powerbi/General%20Reporting%20Help','_blank'))
But, when I deploy this to the report server the value changes to this and if I click the link I get a folder listing:
javascript:void(window.open('/ReportServer/General%20Reporting%20Help','_blank'))
I also see that the parameters #PowerBIReportServer and #SSRSReportServer both have a value of "/ReportServer"
What's going on?
I saw this question\answer:
SSRS 2008 Rpt Bldr 3: Go to URL action not setting parameters
But if "ReportServer" is what's needed in the URL, how do I point to the different report types: SSRS vs Power BI?

So two things resulted in me getting this to work.
Changed **#PowerBIReportServer** to: =REPLACE(Globals!ReportServerUrl, "ReportServer","Reports/PowerBI")
Changed **#SSRSReportServer** to: =Globals!ReportServerUrl + "?"
This link helped me arrive at this solution for the SSRS parameter.
https://community.powerbi.com/t5/Report-Server/Link-to-another-report-using-Built-in-Collections-global/td-p/1645567

Related

In SSRS, a Date Time parameter on Preview is not matching the deployed report

In SSRS, a Date Time parameter on Preview is not matching the deployed report. Is this something someone else has encountered? The RDL code is identical. Is it the fact that, sometimes, a local preview is just a simulation of functionality? Is it because the display in preview sometimes uses cached data?
I have a SSRS report that, when I preview it in Visual Studio locally, the date shows as 2/10/2019 but when the RDL code is deployed on the server, the date shows as 2/7/2019.
The date time variable is based on a parameter on the report, called rundate, and it has a Default Value of 2/10/2019.
So I think the same thing should happen on the Report Server that happens locally in preview mode.
The report has four datasets and, as a test, I have set each four to have the SQL line that sets the rundate value like so:
SET #rundate = '2019-02-10'
but on the report server, when I load the report, it throws this error:
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
It is in a cascading tabbed error message that looks like this:
An error occurred during client rendering.
An error has occurred during report processing.
Query execution failed for dataset 'ThirdDataset.
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
So, why does it run locally and not on the server? The "ThirdDataset" is a false name I have given here. The actual name is redacted. But, I have noticed that this would be the first dataset run if they are run alphabetically. So this leads me to the question: why doesn't the report recognize this as a parameter and why does it complain that it is not declared?
============
UPDATE:
I have set the rundate to be part of a data-driven subscription in a report like so:
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Which is two days ago. Since it is 2/11/2019 today, the rundate parameter passed to the SSRS report on the server should be 2/9/2019.
For fun, to test this out, I set the Default Value rundate parameter to be 8/8/2018 in hopes that the data-driven report would set it properly.
In preview mode locally on Visual Studio, a textbox that set to show the [#rundate] Expression shows 8/8/2018 which is what I would expect, but the Datasets are designed to run off this parameter. Since there is nothing that the sql should retrieve from the database that is that old, the graphs and charts in preview mode should turn up completely empty. Why do they show data?!
Next, let's see what the emailed subscription alert says. It had the date of 2/11/2019 12:00:00 AM. If the data-driven subscription ran like it shouold ahve run, it should of had the date of 2/9/2019 from
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Why did this not work?
On the SSRS server, the RDL file has a parameter default value of 2/11/2019 12:00:00 AM but why did the report get THIS default value? What am I doing wrong and how can I fix this?
As a test, I set this default date/time parameter to 12:12:34 for its time to see what would happen. It reveiled that, yes, this is the date time stamp that is being sent to the report. So I unchecked the "Has Default" box
Then, I noticed in the Step 5 of the data-driven subscription I could not advance to Next > without making a small change:
So, what should happen? Will it show the wacky 8/8/2018 value? Will it show the date from two days ago?
Default values for report parameters are deployed only once to the report server, and then they keep their default value after subsequent deployments. This is so that default parameter values used in development don't overwrite the desired parameter defaults on the production server.
So it looks like when the report was first deployed, #rundate had the default value 2/7/2019 but has since been changed on the local report to 2/10/2019. Go into your report server, find the report and go into the Report Parameters section to edit the parameters and change the default value to what you want it to be (deleting the report from the report server and re-deploying it with the updated parameter will have the same effect, but note that the parameter will maintain that default value going forwards). Alternatively, set the report parameter using an expression so that it is continually up to date.
Regarding updating your parameter value in the Sql statement using the SET statement, you can't actually do it that way - you need to set it in the report's parameter list so that SSRS can set the parameter value. Consequently, your databse server is complaining that you are trying to set the value of a local variable that hasn't been defined in your Sql statement, and thus throws an error message.
So you need to set up the Report Parameters in the report parameters section in the report designer. Your Sql can then reference your parameters like so:
SELECT * FROM MyTable WHERE SomeDate >= #rundate
The parameters normally get mapped into your dataset automatically but you might want to check this by going into the Parameters settings on your dataset to make sure. If the parameter doesn't exist there, set it up.
After lengthy trial and error, I found that the answer was to NOT have the parameter set to have a default value on the SSRS Report Server.

Microsoft Reporting Services - How do you default parameter values, but not display the report?

I'm using Reporting Services 2012. It seems it displays the report unconditionally if you have default values specified in all report parameters. If you specify no default value for any one parameter it doesn't display by default.
Anyone know of a way to default values, but not display the report?
I have come across the same problem before, which certainly became an issue when the default parameters returned a very large number of results. It took a long time for the report to render, only for the user to instantly want to change the defaults and run it again.
Unfortunately the only way around this I discovered was to add a new "Run Report" parameter, that had no default value. The report would display all the other default values, but not the report itself. The end user then had to set "Run Report" to "Yes" to actually render the report, as only at this point was the final parameter set.

SSRS 2008 won't let me override User!UserID with a data driven subscription

I have one SSRS report with two linked reports pointing at it.
One is for users to click and view their data. Behind the scenes, I need it to pass User!UserID as a parameter and hide it.
On the other report, I need to set up a data driven subscription that passes the UserID as a value from the database.
If I publish the report with the parameter defaulted to a value of User!UserID, it will not let me save the subscription and gives an error of
"The '/Admin/Subscriptions/Recruiting Sign Ups' report or shared dataset has user profile dependencies and cannot be run unattended. (rsHasUserProfileDependencies) Get Online Help"
If I remove the default value from the report definition, the subscription works but I cannot get the other linked report to pass UserID as a hidden parameter using the Parameters tab on the SSRS interface (rather than in the RDL definition).
Is there a workaround to this that does not involve VB?
So to rephrase you have report A which you use as a subreport in reports B and C. to be able to make a subsciption to report A you need to remove the default value for the user parameter. the user parameter in report A is hidden and with a default value because you don't want users to be able to set it to someone else.
so there are two ways to solve the issue: get data driven subscriptions accept a default value, or find a way to pass parameters from reports B and C
pass parameters from report B and C:
the interface won't allow you to set hidden parameters, but it works. just open report A, change the parameter to visible, open report B and C, map the parameter, go back to A, set the parameter to hidden again.
get data driven subscriptions to accept a default value:
SSRS tries to be smart by finding out that the parameter has a default value set, but it shouldn't be too hard to fool. try getting the default value from a dataset which uses a sql username function, or something in this direction..

In SSRS, is it possible to set the AutoRefresh value to an expression?

I've set up a report using SSRS and would like it to AutoRefresh constantly as data will continuously be added. Simple solution was to set the value to a constant which is easy enough. However, the report is an error log so I would like for the user to be able to shut it off or delay the refresh while they read the messages. I've tried adding a parameter Refresh as an Integer but I cannot set the AutoRefresh value to an expression via
=Parameters!Refresh.Value
and
=[#Refresh]
SSRS yells at me saying the "Property value is not valid. PARAM is not a valid value for Int32."
I appreciate any help.
Yes, AutoRefresh can use an expression in SSRS 2012.
I was able to set this up correctly on SSRS 2012 and make it work. The data type of the parameter must be Integer. What data type are you using? What version of SSRS are you using?
Edit: I have confirmed it does NOT work in SSRS 2008. However, if you are using SSRS 2008 R2, change the project property TargetServerVersion to SQL Server 2008 R2, and it will work. I have it working in a test environment.

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.