当前位置: 首页 > wzjs >正文

西安高新网站制作wordpress 刷新 link

西安高新网站制作,wordpress 刷新 link,基础建站如何提升和优化,室内设计师培训班费用本文用于介绍如何用Power shell脚本批量发布rdl文件到SQL Server Reporting Service. 用户可根据自己的需要创建类似Publish_All_SSRS.ps1的脚本。 目录 1. 目录结构 2. 创建Base_PublishSSRS.ps1 3. 创建Publish_All_SSRS.ps1 4.注意事项 1. 目录结构 目录结构&#xff…

本文用于介绍如何用Power shell脚本批量发布rdl文件到SQL Server Reporting Service.

用户可根据自己的需要创建类似Publish_All_SSRS.ps1的脚本。

目录

1. 目录结构

2. 创建Base_PublishSSRS.ps1

3. 创建Publish_All_SSRS.ps1

4.注意事项


1. 目录结构

目录结构:

        根目录:C:\Reports

        子目录:子目录里面全是rdl文件, 如NoticeMainReport.rdl

C:\Reports\MainNoticeReports

C:\Reports\JobTickets

C:\Reports\SSRSReports

2. 创建Base_PublishSSRS.ps1

# 以下的param参数会被Push_All_SSRS.ps1调用的时候替换掉,此处放置默认参数只是为了方便知道参数
param([Parameter(Mandatory=$false)][string]$ReportServerUrL = "http://10.236.155.32:20070/ReportServer/ReportService2010.asmx?wsdl", [Parameter(Mandatory=$false)][string]$LocalRDLFilePath = "C:\Reports\MainNoticeReports",[Parameter(Mandatory=$false)][string]$ReportFolderPath = "/MainNoticeReports",[Parameter(Mandatory=$false)][string]$SharedDataSourcePath = "/Agency",[Parameter(Mandatory=$false)][validateSet("Initialize","UploadRDL","UpdateDS")][string]$Action = "Initialize"
)
Function Get-ReportServerInstance{param([Parameter(Mandatory=$true)][string]$ReportUrl,[Parameter(Mandatory=$false)][string]$Namespace)return New-WebServiceProxy -Uri $ReportUrl -UseDefaultCredential -Namespace $Namespace}Function Delete-ItemsByPath{param([Parameter(Mandatory=$true)][object]$RS,[Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$false)][bool]$IsRecurse=$false)$RS.DeleteItem($Path)if($IsRecurse){$RS.ListChildren($Path,$IsRecurse) | %{$RS.DeleteItem($_.Path)}}}Function Upload-ReportToRemoteServer{param([Parameter(Mandatory=$true)][object]$RS,[Parameter(Mandatory=$true)][string]$RDLFilePath,[Parameter(Mandatory=$true)][string]$ReportServerPath)Resolve-Path -Path $RDLFilePath$RDLFile = Get-Item -Path $RDLFilePath$reportName = [System.IO.Path]::GetFileNameWithoutExtension($RDLFile.Name)$bytes = [System.IO.File]::ReadAllBytes($RDLFile.FullName)$warnings=$null$report = $rs.CreateCatalogItem("Report",         # Catalog item type$reportName,      # Report name$ReportServerPath,# Destination folder$true,            # Overwrite report if it exists?$bytes,           # .rdl file contents$null,            # Properties to set.[ref]$warnings)   # Warnings that occured while uploading.$warnings | %{  Write-Output ("Warning: {0}" -f $_.Message)}}Function Create-ReportFolder{Param([Parameter(Mandatory=$true)][object]$RS,[Parameter(Mandatory=$true)][string]$FolderName,[Parameter(Mandatory=$false)][string]$ParentFolderPath="/")$RS.CreateFolder($FolderName,$ParentFolderPath,$null)}Function Test-ItemByPath{Param([Parameter(Mandatory=$true)][object]$RS,[Parameter(Mandatory=$true)][string]$Path)Return ($Rs.ListChildren("/",$true) | ?{$_.Path -eq $Path}) -ne $null}Function Update-DataSource{Param([Parameter(Mandatory=$true)][object]$RS,[Parameter(Mandatory=$true)][string]$SharedDataSourcePath,[Parameter(Mandatory=$true)][string]$ReportFolderPath)$RS.ListChildren($ReportFolderPath,$false) |?{$_.TypeName -eq "Report"} | %{$referencedDataSourceName = (@($rs.GetItemReferences($_.Path, "DataSource")))[0].Name# Change the datasource for the report to $SharedDataSourcePath# Note that we can access the types such as DataSource with the prefix # "SSRS" only because we specified that as our namespace when we # created the proxy with New-WebServiceProxy.$dataSource = New-Object SSRS.DataSource$dataSource.Name = $referencedDataSourceName      # Name as used when designing the Report$dataSource.Item = New-Object SSRS.DataSourceReference$dataSource.Item.Reference = $SharedDataSourcePath # Path to the shared data source as it is deployed here.$rs.SetItemDataSources($_.Path, [SSRS.DataSource[]]$dataSource)            }}$Rs = Get-ReportServerInstance -ReportUrl $ReportServerUrL  -Namespace "SSRS"
if($Action -eq "Initialize")
{if((Test-ItemByPath -RS $RS -Path $ReportFolderPath) -eq $false){Create-ReportFolder -RS $RS -FolderName $ReportFolderPath.remove(0,1)}Resolve-Path $LocalRDLFilePathGet-ChildItem -Path $LocalRDLFilePath | ?{$_.Name -like "*.rdl"} | %{Upload-ReportToRemoteServer -RS $RS -RDLFilePath $_.FullName -ReportServerPath $ReportFolderPath }$RS = $null
}
elseif($Action -eq "UpdateDS")
{Update-DataSource -RS $RS -SharedDataSourcePath $SharedDataSourcePath -ReportFolderPath $ReportFolderPath$RS=$null
}

3. 创建Publish_All_SSRS.ps1

param(	[Parameter(Mandatory=$false)][string]$ReportServerUrL = "http://10.236.155.32:20070/ReportServer/ReportService2010.asmx?wsdl",[Parameter(Mandatory=$false)][string]$ParentRDLFilePath = "C:\Reports\",# 你的rdl所在的路径[Parameter(Mandatory=$false)][string]$SSRSPathPrefix = "ChinaDev_",[Parameter(Mandatory=$false)][validateSet("Initialize","UploadRDL","UpdateDS")][string]$Action = "Initialize"
)$LocalRDLFilePath1 = $ParentRDLFilePath + "MainReports" # Reports目录下面的子目录,里面就是rdl文件了
$LocalRDLFilePath2 = $ParentRDLFilePath + "JobTickets" # Reports目录下面的子目录,里面就是rdl文件了
$LocalRDLFilePath3 = $ParentRDLFilePath + "SSRSReports" # Reports目录下面的子目录,里面就是rdl文件了
$ReportFolderPath1 = "/" + $SSRSPathPrefix + "MainReports" #SSRS 上面的目录结构
$ReportFolderPath2 = "/" + $SSRSPathPrefix + "JobTickets" #SSRS 上面的目录结构
$ReportFolderPath3 = "/" + $SSRSPathPrefix + "SSRSReports" #SSRS 上面的目录结构
$remoteReportDataSource1 = $ReportFolderPath1 + '/Agency' #SSRS 上面的默认数据库连接
$remoteReportDataSource2 = $ReportFolderPath2 + '/Agency' #SSRS 上面的默认数据库连接
$remoteReportDataSource3 = $ReportFolderPath3 + '/Agency' #SSRS 上面的默认数据库连接$BasePS1 = $PSScriptRoot+"\Base_PublishSSRS.ps1"
Write-host "::::::::::::::::::::::::::::::::Update AgencyNotice, JobTicket, SSRS: "$Action
Write-host "::::::::::::::::::::::::::::::::MainReportsStart:"
& $BasePS1 -ReportServerUrL $ReportServerUrL -LocalRDLFilePath $LocalRDLFilePath1 -ReportFolderPath $ReportFolderPath1 -SharedDataSourcePath $remoteReportDataSource1 -Action $ActionWrite-host "::::::::::::::::::::::::::::::::JobTickets Start:"
& $BasePS1 -ReportServerUrL $ReportServerUrL -LocalRDLFilePath $LocalRDLFilePath2 -ReportFolderPath $ReportFolderPath2 -SharedDataSourcePath $remoteReportDataSource2 -Action $ActionWrite-host "::::::::::::::::::::::::::::::::SSRSReports Start:"
& $BasePS1 -ReportServerUrL $ReportServerUrL -LocalRDLFilePath $LocalRDLFilePath3 -ReportFolderPath $ReportFolderPath3 -SharedDataSourcePath $remoteReportDataSource3 -Action $Action

4.注意事项

运行前需要确定你的域账号有访问SSRS的读写权限。

如果你当前的域账号没有权限,可以把Reports目录拷贝到SSRS服务器上再执行。


文章转载自:

http://FabXQhv3.cwyfs.cn
http://X57uwb0z.cwyfs.cn
http://7ShoNSQx.cwyfs.cn
http://3Y0yjrwn.cwyfs.cn
http://4GhwS0lF.cwyfs.cn
http://eTzJX9KP.cwyfs.cn
http://3JDTSQMC.cwyfs.cn
http://NhPYOLk4.cwyfs.cn
http://FboJyErO.cwyfs.cn
http://jVXNRq3r.cwyfs.cn
http://bBUrlK4J.cwyfs.cn
http://KBzbmG0Y.cwyfs.cn
http://hkLybZoZ.cwyfs.cn
http://FOz88yJU.cwyfs.cn
http://w84OwOsv.cwyfs.cn
http://D7jc1QUs.cwyfs.cn
http://uPdbioz0.cwyfs.cn
http://7ElmpBRf.cwyfs.cn
http://kyndHhgY.cwyfs.cn
http://PDhKYMft.cwyfs.cn
http://jO89HIda.cwyfs.cn
http://RIqioU8X.cwyfs.cn
http://enMbx4iG.cwyfs.cn
http://H4EsMqoP.cwyfs.cn
http://oPbbSZFX.cwyfs.cn
http://OCCzFzBx.cwyfs.cn
http://aOidHNJs.cwyfs.cn
http://459kS0Sy.cwyfs.cn
http://GtGdOLmA.cwyfs.cn
http://YrSSV37j.cwyfs.cn
http://www.dtcms.com/wzjs/636541.html

相关文章:

  • 找人做企业网站注意啥设计平台模式
  • 建设公司网站需要准备什么科目安徽网站公司网站
  • 网站怎么做微信送红包活动官方网站下载12306
  • 仙桃网站定制网站制作合作协议
  • 怎样制作表白网站重庆网站建设及优化公司
  • 高端网站制作乐是怎么制作小视频的教程?
  • 网站做百度推广的要求WordPress禁止上传php
  • php快速建网站申请一个域名可以建设一个网站吗
  • 嘉定网站制作深圳专业网站建设
  • 上海网站制作顾wordpress可视化主题
  • 网站除了域名还要什么用网站源码下载插件
  • 网站加急备案无锡企业做网站
  • 大连网站制作诚推ls15227wordpress 输出评论内容 函数
  • 建设网站和ipv4和ipv6什么关系开发手机app多少钱
  • 品牌型网站建设特点网址有哪些组成
  • 广州制作网站开发网站开发佛山
  • 网站网页设计的组成网页qq空间登陆在线登录入口
  • 建站哪个便宜国外做免费网站的
  • 济南专门做网站的公司有哪些百度seo高级优化
  • 水禾田网站建设公司制作网站的原因
  • 网站设计与开发实例快速搭建网站demo
  • 分红网站建设非遗网站建设目的
  • 炫酷文字制作网站广告图案大全图片素材
  • 营销型网站 典型案例网站模版亮点
  • 北京移动端网站html制作电影网页
  • 江门网站快速排名51自学网官网入口
  • 岳阳网站建设哪里有家在深圳龙岗
  • 扶贫网站开发的目的是什么上海网站制作上海网站制作
  • 惠州企业网站设计赣州晒房网
  • 网站建设的主要技术山西建站优化