10

I have the following query:

SELECT TOP ( 10 )
        EMPLOYEE ,
        NAME ,
        SUM(QTYFINISHED) AS QTY ,
        SUM(HOURS) AS REALTIME ,
        SUM(PROCESSTIME * QTYFINISHED / PROCESSQTY / 60) AS CALCTIME ,
        SUM(PROCESSTIME * QTYFINISHED / PROCESSQTY / 60) / SUM(HOURS) AS EFFI
FROM    EMPLOYEE
GROUP BY EMPLOYEE ,
         NAME
ORDER BY Eficience DESC

When I execute it in the 'Query Design' I have the right values:

  Employee  Name     QTY     REALTIME    CALCTIME    EFFI
      2     Peter    10        10           5         0,5
      3     John     10        10           10         1
      4     Thomas   10        12           9         0,75
      ...

But when I add the fields in a table in the report the Preview make some mess between the fields:

  Employee  Name     QTY     REALTIME    CALCTIME    EFFI
      2     10        10           5          0,5    #Error
      3     10        10           10          1     #Error
      4     10        12           9          0,75   #Error
      ...

If I delete the field 'Name' from the query (and of course, from the report), I get the right values in the Query Design and the Report Preview.

note: the real query include a JOIN and fields are referenced with the table namespace, but I let it out due readability reason because I don't believe make any difference.

NePh
  • 966
  • 9
  • 21
HEDMON
  • 727
  • 10
  • 24
  • 1
    Well, obviously the fields are shifted one to the left. I guess you need to update the SSRS data set to reflect the current output of the query. – Thorsten Dittmar Nov 29 '16 at 13:16
  • my bad! Deleted the .rdl.data and it's working. Sorry for the stupid question :(, please, add the answer for give you the points ;) – HEDMON Nov 29 '16 at 13:26
  • 3
    I found that if you hit the refresh icon on the report it will reload the cached data and save you the trouble of deleting the file. – Joe C Nov 29 '16 at 18:40

2 Answers2

25

You must delete the filename.rdl.data in the project folder. This is a feature for SSDT. After deleting the rdl.data file, it will create a new one on the next viewing preview with the proper query and it will remove #ERROR.

Azuraith
  • 1,030
  • 14
  • 28
  • 3
    I believe it was designed as a feature. If you have a long running query it is handy to be able to preview the report over and over without having to run the query each time. Unfortunately it is not intuitive and sure caused me confusion until I learned how it works. – Joe C Nov 29 '16 at 18:42
  • 2
    Oh i see, i will change my answer to reflect that. – Azuraith Nov 29 '16 at 20:02
  • 2
    I also got the same error and i got fixed by the same. thanks a lot! – Sandy Aug 09 '17 at 11:14
2

Another possible way, that will make things easier in the future, is to create an external tool, just like described here:

  • Go to Tools > External Tools...

  • Add a new tool with the following settings:

    • Title: Clear Report Data Cache
    • Command: "%WinDir%\System32\cmd.exe"
    • Arguments: /C DEL /S /Q "$(SolutionDir)*.rdl.data"
    • Check options:
      • Use Output window
      • Close on exit

External Tool

Now whenever you want to delete your report data cache, just go to Tools > Clear Report Data Cache.

How to access

Nizam
  • 4,569
  • 3
  • 43
  • 60