回复 2楼iceman的帖子
我的代码如下
public void PrintExcle()
{
PrintInfo printInfo = new PrintInfo();
printInfo.ShowBorder = false;
printInfo.FitPagesWide = 1;
printInfo.RowStart = -1;
printInfo.ColumnStart = -1;
printInfo.RowEnd = -1;
printInfo.ColumnEnd = -1;
printInfo.FitPagesWide = -1;
printInfo.FitPagesTall = -1;
printInfo.FooterCenter = "age & of &N";
printInfo.ShowRowHeader = VisibilityType.Show;
printInfo.ShowColumnHeader = VisibilityType.Show;
printInfo.FitPagesWide = -1;
printInfo.FitPagesTall = -1;
printInfo.ShowGridLine = true;
foreach (var item in this.gcSpreadSheet1.Sheets)
{
item.PrintInfo = null;
item.PrintInfo = printInfo;
}
this.gcSpreadSheet1.Print();
}
看下是否有问题,为什么会报错 |