Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

reporting services - SSRS Rest API report patch doesn't update parameters

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...