2011-10-24 21 views
8

Al actualizar una máquina, perdimos el proyecto de Visual Studio que se utilizó para crear informes de SSRS. Sin embargo, las fuentes de datos y los informes aún existen en el servidor. ¿Hay alguna manera de volver a crear el proyecto VS usando lo que está en el servidor SQL? ¿Hay alguna manera de crear un nuevo proyecto de Reporting Services e importar fuentes de datos e informes existentes en él?¿Es posible importar informes existentes de SSRS en Visual Studio?

Creo que los informes fueron creados originalmente usando VS 2005.

Respuesta

9

No ha perdido mucho.

Las fuentes de datos no son mucho: la cadena de conexión a una base de datos, y posiblemente la configuración para el almacenamiento en caché y la autenticación. Estos deberían ser fácilmente recreables.

Las definiciones de informe (archivos .rdl) pueden descargarse para cada tipo de informe y agregarse a un nuevo proyecto de Reporting Services. Tendrán que apuntar a las fuentes de datos recién recreado, pero entonces debería estar bien.

Para descargar los archivos del informe, vaya a Reporting Services Report Manager (sitio web). Para una instancia predeterminada de SQL con opciones de instalación predeterminadas, esta es http://servername/reports/. Si tiene permisos de administrador, puede examinar los informes. Vaya a las propiedades de un informe determinado y haga clic en el botón Editar ... Esto descargará el .rdl a través de su navegador. (En SSRS 2008, el botón Editar se cambió a "Descargar ...")

Deberá averiguar qué versión de SSRS está ejecutando: las diferentes versiones de Business Intelligence Developer Studio (BIDS, SSAS y Versión de Visual Studio de SSRS) crea informes para versiones específicas de SSRS. Los informes se pueden actualizar, pero no degradar o implementar en una versión anterior de SSRS.

+0

Gracias, esto es útil. Estamos utilizando la versión 9.00.4053.00 de Microsoft SQL Server Reporting Services. Todavía estoy tratando de averiguar cómo descargar estos archivos .rdl. No he utilizado Reporting Services durante muchos meses, y todavía estoy tratando de recordar cómo configuré esto hace más de un año ... –

+0

@Jamie_F ¡Gracias! Esto me ayudó mucho, y pude reconstruir la solución. :-) –

+1

Considere mover los detalles del comentario para descargar/agregar los datos a la respuesta. Esta fue la parte más valiosa de la respuesta en mi humilde opinión. – Glenn

-1

SSRS no le permite descargar todos los informes desde una carpeta de informes en 1 go ...

Sin embargo he encontrado y ajustado un simple trozo de SQL que he encontrado en la red que se utiliza con gran efecto en nuestro sistema ...

esto es: -

/* 
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 
Cuestiones relacionadas