本文整理汇总了C#中NPOI.HSSF.UserModel.HSSFSheet.SetMargin方法的典型用法代码示例。如果您正苦于以下问题:C# HSSFSheet.SetMargin方法的具体用法?C# HSSFSheet.SetMargin怎么用?C# HSSFSheet.SetMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.HSSF.UserModel.HSSFSheet
的用法示例。
在下文中一共展示了HSSFSheet.SetMargin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: definePrintSetup
/// <summary>
/// Définition des zones d'impression
/// </summary>
/// <param name="_sheet"></param>
/// <param name="_msgCenter"></param>
/// <param name="_scale"></param>
private void definePrintSetup(HSSFSheet _sheet, string _msgCenter, short _scale)
{
HSSFFooter footer = (HSSFFooter)_sheet.Footer;
//you can set right, left, and center footers
footer.Center = _msgCenter;
footer.Right = "Page " + HSSFFooter.Page + " ";
HSSFPrintSetup print = (HSSFPrintSetup)_sheet.PrintSetup;
print.Landscape = true;
//print scale is scale in % – here I’m doing 70%
print.Scale = _scale;
_sheet.SetMargin(NPOI.SS.UserModel.MarginType.TopMargin, (double).50);
//the bottom margin needs to be larger to accommodate my footer text
_sheet.SetMargin(NPOI.SS.UserModel.MarginType.BottomMargin, (double)1.00);
_sheet.SetMargin(NPOI.SS.UserModel.MarginType.LeftMargin, (double).50);
_sheet.SetMargin(NPOI.SS.UserModel.MarginType.RightMargin, (double).50);
}