- 所属分类:网站建设知识
- 作者: 独占网络
- 更新时间: 2015-3-6 10:08:26
- 返回列表
我们导出的excel表格信息,我们经常需要用于打印信息,我们打印出来的信息需要设置边距信息。
sheets.PageSetup.TopMargin=exce.InchesToPoints(0.55);//上边距
sheets.PageSetup.BottomMargin=exce.InchesToPoints(0.55);//下边距
sheets.PageSetup.LeftMargin=exce.InchesToPoints(0.78);//左边距
sheets.PageSetup.RightMargin=exce.InchesToPoints(0.39);//右边距
sheets.PageSetup.HeaderMargin=exce.InchesToPoints(0.39);//页眉
sheets.PageSetup.FooterMargin=exce.InchesToPoints(0.39);//页脚
sheets.PageSetup.CenterHorizontally=true;//水平居中
sheets.PageSetup.PaperSize=Excel.XlPaperSize.xlPaperA4;//纸张大小
sheets.PageSetup.Orientation=Excel.XlPageOrientation.xlLandscape;//纸张方向.横向
如有不懂,联系独占网络(http://www.sz886.com)