<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Layout x:Orientation="Landscape" x:CenterHorizontal="0"/>
<Header x:Margin="0.51181102362204722"/>
<Footer x:Margin="0.51181102362204722"/>
<PageMargins x:Bottom="0.78740157480314965" x:Left="0.39370078740157483"
x:Right="0.39370078740157483" x:Top="0.78740157480314965"/>
</PageSetup>
<Unsynced/>
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>9</PaperSizeIndex>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>9</ActiveRow>
<ActiveCol>9</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
以上代码是从excel中截取的,其实现结果是excel打印时在页面处于非居中,如果想要改变其打印区域在页面中处于居中的效果时,要么从新制表样式,要么可以改变Layout节点中的x:CenterHorizontal属性。
如果x:CenterHorizontal值为1,则excel打印区域居中;若为0,则excel打印时居左。
本文介绍了如何通过调整Excel的WorksheetOptions中的PageSetup布局设置实现打印区域的居中。当Layout节点的x:CenterHorizontal属性设为1时,打印区域会居中;设为0,则会居左。要改变打印效果,可以修改这个属性的值。
942

被折叠的 条评论
为什么被折叠?



