简体   繁体   中英

SSRS Reports with inconsistent Results

I seem to have a problem with getting consistent answers from SSRS. I will explain the situation.

  • I have a table in my database, which we will call "Sales" here. In Sales I have a column called Performance, which is consistent on all of the 23 outputted rows (with today a value of 0.80).
  • I have a Project in visual studio 2012 with SSDT. In this project there are 20 reports, all of them doing something different but having one thing in common: A table on the left side with performance numbers.
  • This performance table is completely loose from the rest of the report. It just refers to a dataset called "Perf", with the query "Select * From Sales". The field in the table that I'm interested in has the function =First(Fields!Performance.Value, "Perf") . I chose this function since every row has the same value for Performance so there should be no difference.
  • When i compare different reports with eachother some of the reports give a correct answer of 0.80, however some of them give an answer of 0.78. How is this possible?

Before running the reports I use the following commands to get rid of cache:

DBCC FREESESSIONCACHE
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS

What am I missing? Am I doing something wrong? Software wise I use SQL Server Management Studio 2012, and Visual Studio 2012. Will give more information where needed

It sounds like it is SSRS report preview using cached results. If you are previewing the report and not changing any parameters for a particular dataset, it will just use a cached copy of the dataset.

In the preview mode, there is a 'refresh' button you can click which I believe deletes the cache and freshly queries the dataset. Alternatively, you can manually delete the cached file. They are located in the same folder as the RDL files.

For instance if your report is called

MyReport.rdl

You'll also find this file (provided you've previewed the report at least once)

MyReport.rdl.data

Delete the .data file and re-run the report. It will fetch a fresh dataset from the source.

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