Search code examples
sql-serverreporting-servicesreport

SSRS Web Service URL Export to PDF with rs:Format=PDF Parameter Not Reflecting Most Recent Data in Exported PFD Report


I am using SSRS (SQL Server Reporting Services) 2022 and trying to export a report to PDF using the Web Service URL. I am adding the parameter "rs:Format=PDF" to the URL to indicate that I want the report to be exported to PDF format.

The problem I am facing is that the exported report is not reflecting the most recent data. When I access the report through Web Service URL with out PDF Export, I can see that it has been updated with the latest data everytime. However, when I export it using the Web Service URL, the exported report is still showing the old data. Example: If report is pulling a customer data and I try pulling the report it gets the most recent data for the first time but when I change any information in customer data then changes are not reflected in report.

Does anyone know why this might be happening and how I can ensure that the exported report reflects the most recent data?

Reports cache settings are set to Always run this report with the most recent data

I have tried

  • Adding other parameters like "rs:ClearSession=true" to the URL
  • Added cache buster parameter that is different every time
  • Added Following tags in Head of ReportViewer.aspx to prevent browser chache

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

But they haven't helped in resolving the issue. Thanks in advance for your help!


Solution

  • RESOLVED The parameter was added in the middle of the URL intially.

    However, the issue was eventually resolved by moving the rs:ClearSession=true parameter to the end of the URL. This change somehow fixed the issue and allowed the URL to function properly.