Question

I have rdlc file report (standtart A4, Landscape), that has

 <PageHeight>21cm</PageHeight>
 <PageWidth>29.7cm</PageWidth>

Problem is, when i'm trying to print (in docx, Word 2010 and 2013) that one of the test printers doesn't understand page format - in "Print preview" window, page size = "Custom page Size 11.69x 8.27", "Landscape Orientation". But document in preview mode is croped from sides. If i select page format "A4" or try to play with margins preview normalizes.

If i select diferent printer everything is well. If i try generating report in pdf also everything is well.

Is this problem with my rdlc, printer or Print preview window? How to solve it? (so that customer won't need to select page format everytime)

Update I opened up my docx as xml, and found that landscape tag was missing w:orient="landscape". If i add it - it works well. Now problem, how to do it programaticly? (ReportViewer.WebForms are user here).

Was it helpful?

Solution 2

So what i did, was workaround but it worked. Using DocumentFormat.OpenXml i manually added document layout.

OTHER TIPS

I always used these settings and never had problems:

<PageHeight>21cm</PageHeight>
<PageWidth>29.7cm</PageWidth>
<LeftMargin>1.3cm</LeftMargin>
<RightMargin>1.3cm</RightMargin>
<TopMargin>1.5cm</TopMargin>
<BottomMargin>1.5cm</BottomMargin>

Maybe you have to set different left/right margins but probably is a specific printer problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top