Поделиться через


Everclear (Setting Published Report Print Properties)

In a previous post, I described some of the rules around report pagination. I mentioned that you can change the page settings of a published report using the SetProperties web service method. This is especially useful in that we neglect to propagate the print settings to linked reports during linked report creation or republishing of the target report. So here is a quick VB snippet that shows you how to set these properties:

Dim rs As New ReportingService.ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.Url = "https://localhost/reportserver/reportservice.asmx"

Dim p(5) As ReportingService.Property
p(0) = New ReportingService.Property
p(0).Name = "PageHeight"
p(0).Value = 8.5 * 25.4
p(1) = New ReportingService.Property
p(1).Name = "PageWidth"
p(1).Value = 11 * 25.4
p(2) = New ReportingService.Property
p(2).Name = "TopMargin"
p(2).Value = 0.5 * 25.4
p(3) = New ReportingService.Property
p(3).Name = "BottomMargin"
p(3).Value = 0.5 * 25.4
p(4) = New ReportingService.Property
p(4).Name = "LeftMargin"
p(4).Value = 0.5 * 25.4
p(5) = New ReportingService.Property
p(5).Name = "RightMargin"
p(5).Value = 0.5 * 25.4

rs.SetProperties("/LinkedReport", p)

Note that all of the measurements are in millimeters. The code is essentially the same for SQL 2005 RS.

Comments

  • Anonymous
    December 28, 2006
    The comment has been removed