Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 是否可以在Visual Studio中导入现有的SSRS报告?_Visual Studio_Reporting Services - Fatal编程技术网

Visual studio 是否可以在Visual Studio中导入现有的SSRS报告?

Visual studio 是否可以在Visual Studio中导入现有的SSRS报告?,visual-studio,reporting-services,Visual Studio,Reporting Services,升级计算机时,我们丢失了用于创建SSRS报告的Visual Studio项目。但是,服务器上仍然存在数据源和报告。有没有一种方法可以使用它在SQL server上的内容重新创建VS项目?是否有方法创建新的Reporting Services项目并导入其中的现有数据源和报表 我相信这些报告最初是使用VS2005创建的。您没有损失多少 数据源并不多:数据库的连接字符串,可能还有缓存和身份验证的设置。这些应该很容易重新创建 可以为每种报告类型下载报告定义(.rdl文件),并将其添加到新的Reporti

升级计算机时,我们丢失了用于创建SSRS报告的Visual Studio项目。但是,服务器上仍然存在数据源和报告。有没有一种方法可以使用它在SQL server上的内容重新创建VS项目?是否有方法创建新的Reporting Services项目并导入其中的现有数据源和报表

我相信这些报告最初是使用VS2005创建的。

您没有损失多少

数据源并不多:数据库的连接字符串,可能还有缓存和身份验证的设置。这些应该很容易重新创建

可以为每种报告类型下载报告定义(.rdl文件),并将其添加到新的Reporting Services项目中。它们需要指向新重新创建的数据源,但这样就可以了

要下载报告文件,请转到Reporting Services报告管理器(网站),以获取具有默认安装选项的默认SQL实例,这是
http://servername/reports/
如果您有管理员权限,可以在那里浏览报告。转到给定报告的属性并单击编辑。。。按钮这将通过浏览器下载.rdl。(在SSRS 2008中,编辑按钮更改为“下载…”


您需要了解正在运行的SSR版本:不同版本的Business Intelligence Developer Studio(BIDS、SSAS和Visual Studio的SSRS版本)为特定版本的SSR创建报告。报告可以升级,但不能降级或部署到较旧版本的SSRS。

SSRS不允许您一次从报告文件夹下载所有报告

然而,我发现并调整了我在网上发现的一个简单的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

现在有一个PowerShell模块可以很好地完成这项工作

out rsfoldercontent-reportserveruri http://[reportserver name]/reportserver-RsFolder/[path you'd export]-目标c:\test-recurse

调整参数以适应


谢谢,这很有帮助。我们使用的是Microsoft SQL Server Reporting Services版本9.00.4053.00。不过,我仍在尝试如何下载这些.rdl文件。我已经好几个月没有使用Reporting Services了,我还在努力回忆一年前我是如何设置的…@Jamie\u F谢谢!这对我帮助很大,我能够重建解决方案。:-)请考虑将评论的细节移动到下载/添加数据到答案中。这是答案中最有价值的部分。