2011-10-24 90 views
8

升級計算機時,我們丟失了用於創建SSRS報告的Visual Studio項目。數據源和報告仍然存在於服務器上。有沒有辦法使用它在SQL服務器上重新創建VS項目?有沒有辦法創建一個新的Reporting Services項目並導入其中的現有數據源和報告?是否可以在Visual Studio中導入現有的SSRS報告?

我相信這些報告最初是使用VS 2005創建的。

回答

9

您並沒有損失太多。

數據源並不多:連接到數據庫的字符串,以及可能的緩存和身份驗證設置。這些應該很容易重新創建。

可以爲每種報告類型下載報告定義(.rdl文件),並將其添加到新的Reporting Services項目中。他們需要指向新創建的數據源,但應該沒問題。

要下載報告文件,轉到Reporting Services報告管理(網站)對於SQL的默認默認實例安裝選項,這是http://servername/reports/如果您擁有管理員權限,也可以通過瀏覽報告。轉到給定報告的屬性並單擊編輯...按鈕。這將通過瀏覽器下載.rdl。 (在SSRS 2008中,「編輯」按鈕已更改爲「下載...」)

您需要了解您正在運行的SSRS版本:不同版本的Business Intelligence Developer Studio(BIDS,SSAS和SSRS版本的Visual Studio)爲特定版本的SSRS創建報告。這些報告可以升級,但不能降級或部署到較舊版本的SSRS。

+0

謝謝,這是有益的。我們正在使用Microsoft SQL Server Reporting Services版本9.00.4053.00。我仍然試圖找出如何下載這些.rdl文件。我有好幾個月沒有使用過Reporting Services,而且我仍然試圖記住我在一年前如何設置這個... –

+0

@Jamie_F謝謝!這對我幫助很大,我能夠重建解決方案。 :-) –

+1

請考慮移動評論的下載/添加數據到答案的細節。這是答案恕我直言的最有價值的部分。 – Glenn

-1

SSRS不允許你從報表文件夾下載所有報告在1個去...

但是我發現和調整一段簡單的SQL我對我們用它來很大的影響在網絡上找到我們的系統......

這是它: -

/* 
People working on SSRS are well aware that 「Report Manager」 does not support downloading all the report files (.rdl files) at one go out-of-box. 
However take this script, alter the xxx parameters to your bits. Its works great. 
If you get a HOST Error - you need to set full permission to the SQL Server Group on your DOS Dir. 
on [Our_Prod_Server], this is: SQLServerMSSQLUser$NS226758$MSSQLSERVER 

NOTE: You will find a RETURN; statement below, comment it out once you have altered the parameters. 
*/ 

--Replace NULL with keywords of the ReportManager's Report Path, 
--if reports from any specific path are to be downloaded 
--select * from [ReportServer].[dbo].[Catalog] CL -- this gives you an idea of the Report Directories. 
DECLARE @FilterReportPath AS VARCHAR(500) = 'xxx' 

--Replace NULL with the keyword matching the Report File Name, 
--if any specific reports are to be downloaded 
DECLARE @FilterReportName AS VARCHAR(500) = '' 

--Replace this path with the Server Location where you want the 
--reports to be downloaded.. 
DECLARE @OutputPath AS VARCHAR(500) = 'C:\Users\[uuuuu]\Documents\Visual Studio 2012\Projects\Report Skeleton\[Report DIR Name]\' 

--Used to prepare the dynamic query 
DECLARE @TSQL AS NVARCHAR(MAX) 

RETURN; 

--Reset the OutputPath separator. 
SET @OutputPath = REPLACE(@OutputPath,'\','/') 

--Simple validation of OutputPath; this can be changed as per ones need. 
IF LTRIM(RTRIM(ISNULL(@OutputPath,''))) = '' 
BEGIN 
    SELECT 'Invalid Output Path' 
END 
ELSE 
BEGIN 
    --Prepare the query for download. 
    /* 
    Please note the following points - 
    1. The BCP command could be modified as per ones need. E.g. Providing UserName/Password, etc. 
    2. Please update the SSRS Report Database name. Currently, it is set to default - [ReportServer] 
    3. The BCP does not create missing Directories. So, additional logic could be implemented to handle that. 
    4. SSRS stores the XML items (Report RDL and Data Source definitions) using the UTF-8 encoding. 
     It just so happens that UTF-8 Unicode strings do not NEED to have a BOM and in fact ideally would not have one. 
     However, you will see some report items in your SSRS that begin with a specific sequence of bytes (0xEFBBBF). 
     That sequence is the UTF-8 Byte Order Mark. It’s character representation is the following three characters, 「」. 
     While it is supported, it can cause problems with the conversion to XML, so it is removed. 
    */ 
    SET @TSQL = STUFF((SELECT 
         ';EXEC master..xp_cmdshell ''bcp " ' + 
         ' SELECT ' + 
         ' CONVERT(VARCHAR(MAX), ' + 
         '  CASE ' + 
         '   WHEN LEFT(C.Content,3) = 0xEFBBBF THEN STUFF(C.Content,1,3,'''''''') '+ 
         '   ELSE C.Content '+ 
         '  END) ' + 
         ' FROM ' + 
         ' [ReportServer].[dbo].[Catalog] CL ' + 
         ' CROSS APPLY (SELECT CONVERT(VARBINARY(MAX),CL.Content) Content) C ' + 
         ' WHERE ' + 
         ' CL.ItemID = ''''' + CONVERT(VARCHAR(MAX), CL.ItemID) + ''''' " queryout "' + @OutputPath + '' + CL.Name + '.rdl" ' + '-T -c -x''' 
        FROM 
         [ReportServer].[dbo].[Catalog] CL 
        WHERE 
         CL.[Type] = 2 --Report 
         AND '/' + CL.[Path] + '/' LIKE COALESCE('%/%' + @FilterReportPath + '%/%', '/' + CL.[Path] + '/') 
         AND CL.Name LIKE COALESCE('%' + @FilterReportName + '%', CL.Name) 
        FOR XML PATH('')), 1,1,'') 

    --SELECT @TSQL 

    --Execute the Dynamic Query 
    EXEC SP_EXECUTESQL @TSQL 
END 
相關問題