SSRS Report Rest open in PDF

I have a web app using Node and I am trying to display reports in a PDF. I have everything working up to the point of opening the data in the PDF. The response with the RPTData gives an undefined error when using the code below where resData is the response body from Rest. Do I need to convert the response from an object to something else before opening the pdf?

let pdfWindow = window.open("");

pdfWindow.document.write("<iframe width=‘100%’ height=‘100%’ src=‘data:application/pdf;base64, " + encodeURI(resData[0][‘SysRptLst_RptData’]) + "’>" );

image

Answered my own question.
Needed to use the value property to the data.

encodeURI(resData.value[0]

1 Like