简体   繁体   中英

Local SSRS Report Execution is Caching Dynamic Variable, Even After Deleting .rdl.data

I have a report which I've recently deployed to SSRS, which each month, is meant to generate a report of results for the previous month.

I begin by dynamically generating variables which determine what month/year to generate the report results for :

DECLARE @ReportingMonth int
SET @ReportingMonth = MONTH(GETDATE()) - 1


DECLARE @ReportingYear int
SET @ReportingYear = YEAR(DATEADD(MONTH,-1,GETDATE()))

Then, in the where clause I simply filter results for MONTH(DateColumn) = @ReportingMonth and YEAR(DateColumn) = @ReportingYear

The first month I ran this report was October, thus the results were for 9-2016. I include a field in which I use

CAST(@ReportingMonth AS nvarchar)+'-'+CAST(@ReportingYear AS nvarchar) [Report Period]

To verify results. I just ran the report again locally, and since it is now November, @ReportingMonth should = 10. @ReportingMonth is still set = 9 however. I copy/pasted the data source query directly into SSMS to check that I hadn't made some error, and no - when the query is executed directly, the results do return for 10-2016.

I've seen weird caching results happen with local runs of reports in SSRS before, and deleting the .rdl.data file, then re-running had always solved this sort of thing in the past. Tried that multiple times here with no luck.

Where else could SSRS be caching these variables based on that first month's run?

i had some issues with ssrs cash too. this code solved it go Tools>> external tools>>

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM