Solved

SSRS Linked Report doesn't seem to honour Page settings when printed

Posted on 2013-11-15
4
1,398 Views
Last Modified: 2013-11-18
Hi Experts,

I have a report that is designed for A4 portrait, where the page size and interactive page size are 8.27 x 11.69. The margins are set at 0.25in all round, giving an available width for the body of 7.77 inches. Currently, the Body width property is 7.67717in, so a little room to spare.

There are 4 subreports on the main report, and I have made sure they all have a Body with of 7.677in and start at horizontal location 0 on the main report. A couple have column groups and could extend onto a 2nd page, but that isn't what's happening here. ConsumeContainerWhitespace is true on all sub-reports and the main report.

I deploy to the server into one location, and have set up other locations for other parts of the business with Linked Reports, with their own set of report parameters defaults.

If I use the report from its original location, enter my parameters, View Report and print to my default printer, I get 4 pages and all is good.

If I navigate to the other location and select the linked main report, then set all parameters to the same values - that is override the different defaults - and View Report, all looks identical. But, when I print, the left margin is quite a bit bigger and data items spill over onto a 2nd horizontal page and I get 8 in total. But, only whole columns, so I believe this to be an SSRS layout / render issue, not down at the printer.

Checking the default printer properties from the Print dialogue in Report Manager shows it is wanting Letter. In fact, using Preview from the Printer dialogue is also correct from the original deployment location, and spread over two pages for each page from the Linked Reports folder.

Final test - delete the Linked Report and upload as an original deployment, and all is OK.

Does anyone know what is going on here, have any experience of the issue, or know how to resolve it, because the concept of Linked Report is going to be very handy for us - assuming we can rely on it.

I'm off now until Monday - have a flight to catch, so won't be a quick reply to any responses I'm afraid.

Cheers, and thanks for the help in advance.

Mark
0
Comment
Question by:SeeHearMark
  • 3
4 Comments
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 500 total points
ID: 39655626
The bad news is that this is related to a bug in which page margin properties are not propagated to the linked report: linked report makes a landscape report appear portrait in print preview

The even worse news is that MS closed it with the "Won't fix" status, without any explanation whatsoever...

There are a couple of workarounds, one of them is to use the following RS script to set those properties:

Dim rs As New ReportingService.ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.Url = "http://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)

Open in new window

The other workaround involves a trigger on the ReportServer DB.  It will probably work but I'm sure MS won't support this... See the workarounds tab on the bug report if you're interested in that option...
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39655662
More bug reports related to the issue, please vote them all up to get this issue sorted!

Linked Reports do not honour page margins
[SSRS] Report margins do not propagate to linked report and other bugs - still active!!

And here's another script which you may find interesting (from For If You Cannot Fly (Updating Linked Report Page Settings)).  It sets the page properties for all linked reports on your report server. It copies the relevant properties from the base report to the linked report.

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

rs.Url = "http://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

Open in new window

0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39655682
One more (still active as well!): Properties from Report to Linked Report
0
 

Author Closing Comment

by:SeeHearMark
ID: 39656127
We meet again Valentino :)

Many thanks for the comprehensive pointers to the bug reports and the work-arounds - the one that copies the properties from the source report looks just the job. Going off now to +1 the posts!

Cheers
Mark
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now