Sunday, October 30, 2005
Wednesday, October 26, 2005
Monday, October 17, 2005
Sunday, October 16, 2005
Friday, October 14, 2005
Separating Data Layer from Reporting Layer in RS
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:
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!
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:
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!
Thursday, October 13, 2005
Read from a text file into SQL table without BCP
One of my co-workers asked how to read a text file into a table.
Without using BCP, here is one way of doing it... (must have xp_cmdshell enabled.)
-- This procedure reads the ALL text file which contains the currently
-- running date and displays the results
DECLARE @FileCommand as varchar(255)
SET @FileCommand = 'type c:\all.txt'
-- =============================================
-- Create table basic template
-- =============================================
IF EXISTS(SELECT name
FROM sysobjects
WHERE name = 'TempDateCheck'
AND type = 'U')
DROP TABLE TempDateCheck
CREATE TABLE TempDateCheck (
Contents varchar(100) NULL)
INSERT INTO TempDateCheck
EXEC xp_cmdshell @FileCommand
SELECT Contents
FROM TempDateCheck
Without using BCP, here is one way of doing it... (must have xp_cmdshell enabled.)
-- This procedure reads the ALL text file which contains the currently
-- running date and displays the results
DECLARE @FileCommand as varchar(255)
SET @FileCommand = 'type c:\all.txt'
-- =============================================
-- Create table basic template
-- =============================================
IF EXISTS(SELECT name
FROM sysobjects
WHERE name = 'TempDateCheck'
AND type = 'U')
DROP TABLE TempDateCheck
CREATE TABLE TempDateCheck (
Contents varchar(100) NULL)
INSERT INTO TempDateCheck
EXEC xp_cmdshell @FileCommand
SELECT Contents
FROM TempDateCheck
Wednesday, October 05, 2005
Danyel's Blog : Excel Treemapper
Danyel's Blog : Excel Treemapper Heat Maps & Tree maps make looking at large datasets easy.
Subscribe to:
Posts (Atom)