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


For If You Cannot Fly (Updating Linked Report Page Settings)

I previously showed how you can programmatically set the page size properties (used by the print control) for a specific report on the server. I created an updated version of this sample that will set the page properties for all linked reports on your report server. It copies the relevant properties from the base report to the linked report. If you are using the rs.exe script host, you can delete the proxy methods at the top as they are handled automatically. This example uses the SQL 2000 RS SOAP endpoint but will work for SQL 2005 RS as well.

Dim rs As New ReportingService.ReportingService
Dim ci(), c As ReportingService.CatalogItem
Dim l As String

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

ci = rs.ListChildren("/", True)

For Each c In ci
If c.Type = ReportingService.ItemTypeEnum.LinkedReport Then
Dim p(5) As ReportingService.Property

p(0) = New ReportingService.Property
p(0).Name = "PageHeight"

p(1) = New ReportingService.Property
p(1).Name = "PageWidth"

p(2) = New ReportingService.Property
p(2).Name = "TopMargin"

p(3) = New ReportingService.Property
p(3).Name = "BottomMargin"

p(4) = New ReportingService.Property
p(4).Name = "LeftMargin"

p(5) = New ReportingService.Property
p(5).Name = "RightMargin"

l = rs.GetReportLink(c.Path)
p = rs.GetProperties(l, p)
rs.SetProperties(c.Path, p)
End If
Next

Comments

  • Anonymous
    October 11, 2005
    Thank you, this was really helpfull!
  • Anonymous
    October 12, 2005
    I'm sorry, but what language is this? And aren't you the guy from Thumper?
  • Anonymous
    October 28, 2005
    I have application which is using Reporting Services which uses of SQL 2000 RS.

    I am planning to move to SQL 2005, in this scenario , can you suggest any plans of using Reporting Services of 2005 which makes use of the concept of SOAP End point as suggested.

    Regards,
    V
  • Anonymous
    November 01, 2005
    The comment has been removed
  • Anonymous
    May 31, 2009
    PingBack from http://portablegreenhousesite.info/story.php?id=2353
  • Anonymous
    May 31, 2009
    PingBack from http://portablegreenhousesite.info/story.php?id=11976