Welcome to MSDN Blogs Sign in | Join | Help

How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

You may have noticed that starting with SSRS SP1, when you preview a report which contains data in the designer, a ReportName.RDL.Data file appears on your file system. We store the data that was just displayed by your preview action in this file so we don't have to round-trip to the server over and over again each time you preview the report (assuming you don't change any parameter values, etc.)

If you want, you can use this data file to make your report more "portable" -- Basically taking the report.rdl and report.rdl.data files to another machine that doesn't have access to the "real" data store. You can also use this method to send the report/data to a buddy if you need some help troubleshooting the report. Cool hack!

Close Visual Studio and add the following lines to Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe.config file:

    <system.diagnostics>
       <switches>
          <add name="Microsoft.ReportDesigner.ReportPreviewStore.ForceCache" value="1" />
       </switches>
    </system.diagnostics>

What this entry does is force the preview pane to bypass checking that the cache (data file) is up-to-date and that any report parameter values selected in the report match those used to generate the cached data in the local file.

Next, Create a new VS Report Project and add the existing (rdl) report to it. Drop your rdl.data file in the same folder.

(This is the strange part) Add a new shared datasource to the project, giving it the SAME name as the old datasource your report used in the other project it lived in previously. You don't need even need to specify connection string in his data source -- it'll be using the cached data in your rdl.data file.

Finally (if necessary), modify the report so that any parameters in it don't use queried values (which you no longer have data for) , and that all parameters have valid default values. You also need to remove any other datasets that use data not coming from your .rdl.data file.

Preview!

 

 

Published Wednesday, June 22, 2005 6:20 AM by russch

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

Friday, February 24, 2006 4:50 PM by dab123
what about if you are still getting errors where you have many datasets in your report that are referencing stored procs?

# re: How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

Wednesday, March 01, 2006 5:45 PM by russch
Dunno, honestly...since this "feature" isn't documented anyway, I'd think you're own your own using it...sorry.

# re: How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

Thursday, October 25, 2007 10:54 AM by wf

Of course it's not documented, but it's an useful way to show the report to an user without using a db connection.

dab123, if you are not using a connection, how do you spect the report to use stored procedures? This way only works when you don't need to use any connection to a database.

Regards,

# re: How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

Thursday, December 11, 2008 4:55 PM by pc game cheats

# re: How to preview a report without direct access to its data source in SQL Server Reporting Services 2000

Thursday, April 09, 2009 2:04 AM by Alexander Yaremchuk

Hello, Russell!

Seems that your post is the single source on this topic in whole internet.

We currently have plans to make same trick with "Report Builder 2.0".

(As our clients want to edit rdl without access to real data)

Could you give any advice,please ?

I'm triing to go through it same way as written here.

Thanks, Alex

# Russell Christopher s Semi Useful BI Musings How to preview a report | Paid Surveys

# Russell Christopher s Semi Useful BI Musings How to preview a report | debt settlement program

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker