Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have rdl files locally, and I want to use SSRS Rest API to update the reports in the report server (if there are any changes.)

I am using PATCH to send the request to the report server. Like this

BaseUrl: http://<report_server_ip>/reports/api/v2.0/reports(d0d2791e-b332-4d45-a233-579e86c1fc70)
Method: PATCH
Content Type: application/json
Body:
{    
  "Name":"My Report",
  "Description": "",
  "Path": "/Test/My Report",
  "Type": "Report",
  "Hidden": false,
  "Content":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxSZXBvcnQgTXVzdFVuZGVyc3RhbmQ9ImRmIiB..."
}

For Content, I open the rdl file and read all bytes and convert it to Base64 string. Like this:

content=File.ReadAllBytes(path) //path is the local rdl file path
Convert.ToBase64String(ASCII.GetBytes(content))

If I open the rdl file in a text editor (Notepad++), I see that the report parameter XML node has changes but when I send the PATCH request, the report parameters in the report server are not updated.

Here is the link to the SSRS Rest API: https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/Reports/UpdateReport

question from:https://stackoverflow.com/questions/65889043/ssrs-rest-api-report-patch-doesnt-update-parameters

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

In order to update parameters using SSRS Rest API, you must pass HasParameters: true in the body.

If HasParameters is not set then the API will not update the parameters.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...