cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
devnull
Frequent Visitor

Updating parameter in a published report

I am on Report Server version 1.12.7936.39665

and trying to update one parameter in a simple published report,

with PBRS REST API (PBIRS | 2.0 | microsoft-rs | SwaggerHub)

but despite the successful update, the parameter keeps its original value.

 

Here is the simple steps to recreate the issue:

 

1. Publishing a simple single query report to path /MyReport,
with paramater called Databasename.

 

2. Double checking the current paramater value with a simple GET call:
http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters

 

gives me back the expected original parameter value from the report which is:

"Name": "Databasename",
"Value": "MyOriginalDb"


3. Now updating the parameter for the report with a POST message:
http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters

 

Message body:

	[
	  {
		"Name": "Databasename",
		"Value": "MyNewDb"
	  }
	]

 

Works as expected, i have a successful POST pesponse.
Also the PowerBI report server log shows no error on my POST message.

So the report now has the Databasename parameter with MyNewDb value.


4. Issuing a GET for the report, it gives back the expected new value which is "MyNewDb:"
http://MyReportServer/Reports/api/v2.0/PowerBIReports(path='/MyReport')/DataModelParameters

 

Response:

	{
		"@odata.context": "http://MyReportServer/Reports/api/v2.0/$metadata#Collection(Model.DataModelParameter)",
		"value": [
			{
				"Name": "Databasename",
				"Value": "MyNewDb"
			}
		]
	}


Indeed, the parameter update went fine in the published report.


5. Now comes the problem:
Opening the report directly from the report server (even with Power BI Desktop app)
still uses and has the old paramater value "MyOriginalDb" instead of "MyNewDb"
(even after refresh)

 

 

Tried with PBRS PowerShell tools as well: GitHub - microsoft/ReportingServicesTools: Reporting Services Powershell Tools

Same issue.

 

 

Is it a bug? Seems like the report is cached somehow at the web portal side and not updating with the backend?

What could be the workaround here?

 

1 ACCEPTED SOLUTION


@devnull wrote:

How can one make sure the uploaded report gets the changes as well?


So if you want the same parameter value in your pbix file and on the server then just set the parameter in PBI Desktop before you upload it.

 


@devnull wrote:

This couldn't be the intended feature, can it?

 


I'm pretty sure this is by design. One of the common use cases for an admin to override a parameter on the server it's because the user only has access to a dev/test server or database. So they develop the report against that non-prod data, then they upload to the Report Server and the scheduled refresh pulls from the production database or server.

 

When you are in this scenario and the user clicks on "Edit in Power BI Desktop" the user would need to use the non-prod parameter to make any changes to the report. If the parameter values from the server were merged in then they would get access denied errors when attempting to change anything in the queries.

 

It can be confusing at first to see a different data when you click on Edit compared to what you see on the server, but I believe the scenario above is what they were targeting. 

View solution in original post

5 REPLIES 5
devnull
Frequent Visitor

You are right. After a scheduled refresh, the report indeed points to the proper db, BUT:

 

What will be extremely confusing for the users: if they try to edit this "updated" report (with "Edit in Power BI Desktop" button), then save, and publish their changes back to the server, they publish back the old database name again.

 

Now i have two entities on the server:

1. one is the backsground, updated report, which is observable through the web ui

2. other is the old version opening up through the "edit in power bi dekstop" button

 

This couldn't be the intended feature, can it?

How can one make sure the uploaded report gets the changes as well?

Do it right when uploading?


@devnull wrote:

How can one make sure the uploaded report gets the changes as well?


So if you want the same parameter value in your pbix file and on the server then just set the parameter in PBI Desktop before you upload it.

 


@devnull wrote:

This couldn't be the intended feature, can it?

 


I'm pretty sure this is by design. One of the common use cases for an admin to override a parameter on the server it's because the user only has access to a dev/test server or database. So they develop the report against that non-prod data, then they upload to the Report Server and the scheduled refresh pulls from the production database or server.

 

When you are in this scenario and the user clicks on "Edit in Power BI Desktop" the user would need to use the non-prod parameter to make any changes to the report. If the parameter values from the server were merged in then they would get access denied errors when attempting to change anything in the queries.

 

It can be confusing at first to see a different data when you click on Edit compared to what you see on the server, but I believe the scenario above is what they were targeting. 

Thank you d_gosbell! Yes it is confusing, but it seems it is what it is.

d_gosbell
Super User
Super User


@devnull wrote:

5. Now comes the problem:
Opening the report directly from the report server (even with Power BI Desktop app)
still uses and has the old paramater value "MyOriginalDb" instead of "MyNewDb"
(even after refresh)

 


If I understand correctly I believe this is actually the expected behaviour. When you override the parameter values on the server those overrides are stored on the server. If you download the PBIX file the original "design time" values for those parameters are returned. The new values are not injected into the PBIX file, rather they are used at run time when a scheduled refresh is triggered. 

 

When you trigger a scheduled refresh on the server the data should be coming from the DatabaseName specified in the updated parameter on the server.

You are right. After a scheduled refresh, the report indeed points to the proper db, BUT:

 

What will be extremely confusing for the users: if they try to edit this "updated" report (with "Edit in Power BI Desktop" button), then save, and publish their changes back to the server, they publish back the old database name again.

 

Now i have two entities on the server:

1. one is the backsground, updated report, which is observable through the web ui

2. other is the old version opening up through the "edit in power bi dekstop" button

 

This couldn't be the intended feature, can it?

How can one make sure the uploaded report gets the changes as well?

Do it right when uploading?

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!