SQL Server Reporting Service - 一步部署 TFS 项目报表
2009-02-24 12:55
453 查看
上次介绍了 SQL Server Reporting Service 命令行部署报表的基本内容, 利用这些知识我们可以轻松的部署报表, 然而在 TFS 中, 每个项目都有它对应的报表, 这些报表如果要一个个的更新也是件痛苦的事情, 现在我也遇到了这个问题, 针对 TFS 开发了两张报表, 但是如何将这些报表应用到所有项目上呢? 结合之前的部署脚本知识, 我们可以使用下面方法实现:
首先建立一个批处理文件ImportWIT.bat, 用来更新某个项目的Work Item定义文件:
@ECHO OFF
CALL "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
witimport /t %1 /p %2 /f WorkItemDefinitions\Task.xml
witimport /t %1 /p %2 /f WorkItemDefinitions\Bug.xml
witimport /t %1 /p %2 /f WorkItemDefinitions\Scenario.xml
rem /t %1 /p %2
rem echo Hit any key to continue
rem PAUSE
在WorkItemDefinitions目录下将所有对应Work Item定义文件放入:
'=============================================================================
' File: PublishSampleReports.rss
'
' Summary: Demonstrates a script that can be used with RS.exe to
' publish the sample reports that ship with Reporting Services.
'
'---------------------------------------------------------------------
' This file is part of Microsoft SQL Server Code Samples.
'
' Copyright (C) Microsoft Corporation. All rights reserved.
'
' This source code is intended only as a supplement to Microsoft
' Development Tools and/or on-line documentation. See these other
' materials for detailed information regarding Microsoft code samples.
'
' THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
' KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
' IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'=============================================================================
'
' 1.0 Documentation
'
' Read the following in order to familiarize yourself with the sample script.
'
' 1.1 Overview
'
' This sample script uses a script file (.rss) and the script environment to run
' Web service operations on a specified report server. The script creates a folder
' that you specify as a command-prompt variable using the 杤 switch, and then
' publishes the sample reports that ship with Reporting Services to a report server.
' Depending on the location of your sample reports, you may need to modify the
' value of the filePath variable, which references the path to your sample reports.
'
' 1.2 Script Variables
'
' Variables that are passed on the command line with the -v switch:
'
' (a) parentFolder - corresponds to the folder that the script creates and uses
' to contain your published reports
'
' 1.3 Sample Command Lines
'
'
' 1.3.1 Use the script to publish the sample reports to an AdventureWorks Sample Reports folder.
'
' rs -i PublishSampleReports.rss -s http://myserver/reportserver
'
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentFolder As String = ""
Dim parentPath As String = "/" + parentFolder
Dim filePath As String = "Reports\"
根据上面的代码可以看到需要一个保存项目名的文件, 最后我们就创建一个ProjectInfo.ini文件, 该文件内容留空即可.
上述文件都船舰好了之后接着创建一个总体的脚本, 命名为Update.bat, 内容为:
@ECHO OFF
copy nul ProjectInfo.ini /y
echo %2>>ProjectInfo.ini
RS -i "PublishReports.rss" -s "http://%1/ReportServer/"
ImportWIT.bat %1 %2
以上就是所有需要创建的内容, 如下:
update.bat [TFSServerName] [TeamProjectName]
这样就可以将一个Team Project中的工作项和报表更新成脚本中提到的内容.
完整升级包下载: http://files.cnblogs.com/WilsonWu/TFS_2008_SSWTemplateUpdateScript_ver1-1.zip
首先建立一个批处理文件ImportWIT.bat, 用来更新某个项目的Work Item定义文件:
@ECHO OFF
CALL "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
witimport /t %1 /p %2 /f WorkItemDefinitions\Task.xml
witimport /t %1 /p %2 /f WorkItemDefinitions\Bug.xml
witimport /t %1 /p %2 /f WorkItemDefinitions\Scenario.xml
rem /t %1 /p %2
rem echo Hit any key to continue
rem PAUSE
在WorkItemDefinitions目录下将所有对应Work Item定义文件放入:
'=============================================================================
' File: PublishSampleReports.rss
'
' Summary: Demonstrates a script that can be used with RS.exe to
' publish the sample reports that ship with Reporting Services.
'
'---------------------------------------------------------------------
' This file is part of Microsoft SQL Server Code Samples.
'
' Copyright (C) Microsoft Corporation. All rights reserved.
'
' This source code is intended only as a supplement to Microsoft
' Development Tools and/or on-line documentation. See these other
' materials for detailed information regarding Microsoft code samples.
'
' THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
' KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
' IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'=============================================================================
'
' 1.0 Documentation
'
' Read the following in order to familiarize yourself with the sample script.
'
' 1.1 Overview
'
' This sample script uses a script file (.rss) and the script environment to run
' Web service operations on a specified report server. The script creates a folder
' that you specify as a command-prompt variable using the 杤 switch, and then
' publishes the sample reports that ship with Reporting Services to a report server.
' Depending on the location of your sample reports, you may need to modify the
' value of the filePath variable, which references the path to your sample reports.
'
' 1.2 Script Variables
'
' Variables that are passed on the command line with the -v switch:
'
' (a) parentFolder - corresponds to the folder that the script creates and uses
' to contain your published reports
'
' 1.3 Sample Command Lines
'
'
' 1.3.1 Use the script to publish the sample reports to an AdventureWorks Sample Reports folder.
'
' rs -i PublishSampleReports.rss -s http://myserver/reportserver
'
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentFolder As String = ""
Dim parentPath As String = "/" + parentFolder
Dim filePath As String = "Reports\"
根据上面的代码可以看到需要一个保存项目名的文件, 最后我们就创建一个ProjectInfo.ini文件, 该文件内容留空即可.
上述文件都船舰好了之后接着创建一个总体的脚本, 命名为Update.bat, 内容为:
@ECHO OFF
copy nul ProjectInfo.ini /y
echo %2>>ProjectInfo.ini
RS -i "PublishReports.rss" -s "http://%1/ReportServer/"
ImportWIT.bat %1 %2
以上就是所有需要创建的内容, 如下:
update.bat [TFSServerName] [TeamProjectName]
这样就可以将一个Team Project中的工作项和报表更新成脚本中提到的内容.
完整升级包下载: http://files.cnblogs.com/WilsonWu/TFS_2008_SSWTemplateUpdateScript_ver1-1.zip
相关文章推荐
- SQL Server Reporting Service 报表自动部署 命令行
- SQL Server Reporting Service 报表自动部署 C#程序简化版
- 报表项目控件Nevron Gauge for SQL Server Reporting Services
- SQL Server 2008 Express Reporting Service项目部署时提示输入用户名和密码或提示找不到"http://localhost/ReportServer”
- SQL Server Reporting Service 报错:报表服务器无法解密用于访问报表服务器数据库中的敏感数据或加密数据的对称密钥,必须还原备份密钥或删除所有加密的内容。
- 在Sql Server Intergration Service中设置Catalog下所部署所有项目的参数值
- SQL Server Reporting Service 报错:报表服务器无法解密用于访问报表服务器数据库中的敏感数据或加密数据的对称密钥,必须还原备份密钥或删除所有加密的内容。
- SQL Server Reporting Service - 命令行部署脚本介绍
- TFS问题集--团队项目创建项无法连接到指定SQL Server Reporting Services
- Sql Server Report Service 的部署问题(Reporting Service 2014為什麼不需要IIS就可以運行)
- 在每页(分页)报表中重复显示标题 - SQL Server Reporting Service (SSRS)
- 部署一个jsp+sql server项目
- [收藏]利用SQL Server Reporting Services 从应用程序生成用户友好的报表
- 部署SQL Server Analysis Service (分析服务): 帳戶名稱與安全性識別碼無法對應
- 部署高可用的Lync Server 2013 Part 3 部署SQL见证服务器和报表服务 推荐
- TIP: Configure SQL Server Reporting Service 2008
- 无法访问SQL Server Reporting Service 命名实例
- 163email,sqlserver reporting service,csdn blog...
- SQL Server Reporting Service SP1发布
- ASP.Net Mvc3 Razor Sql Server Reporting Service