Are you sure your report is sized correctly to fit in a landscape page dimensions? Take a look at the answer to this question for some tips on PDF formatting:
How to create pdf programatically from microsoft report (.rdl) in Landscape?
-
12-06-2023 - |
質問
I am using Microsoft report (.rdl), I have changed its layout to landscape in report properties. It shows landscape in report viewer but when I save it to pdf through report viewer or by programatically, It didn't save pdf in landscape. It saves pdf in portrait and render one page report to multiple pages.
解決
他のヒント
All you have to do is alternate the report width and height in Report Properties. If you want it on A4 sheet, then give width=29cm and height=21cm.
You can also modify the PageHeight and PageWidth in the DeviceInfo settings.
Example:
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>PDF</OutputFormat>";
if (!landscape)
{ // display report in portrait
deviceInfo +=
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>";
}
else // display report in Landscape
{
deviceInfo +=
" <PageWidth>16in</PageWidth>" +
" <PageHeight>8.5in</PageHeight>";
}
deviceInfo +=
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
所属していません StackOverflow