使用我的 EPPlus 代码创建的电子表格的“打印预览”显示了装订线/行号列(可以说是第 0 列):
如何以编程方式防止打印排水沟/行号(“裂缝?”)列?
我的打印设置代码目前如下:
private void ConfigureCustomerSheetForPrinting()
{
string columnName = GetExcelTextColumnName(customerWorksheet.Dimension.End.Column);
string printArea = string.Format("A1:{0}{1}", columnName, customerWorksheet.Dimension.End.Row);
customerWorksheet.PrinterSettings.PrintArea = customerWorksheet.Cells[printArea];
customerWorksheet.PrinterSettings.FitToPage = true;
customerWorksheet.PrinterSettings.Orientation = eOrientation.Landscape;
customerWorksheet.View.ZoomScale = 100;
customerWorksheet.PrinterSettings.FitToPage = true;
customerWorksheet.PrinterSettings.FitToHeight = 100;
customerWorksheet.PrinterSettings.Scale = 100;
customerWorksheet.PrinterSettings.LeftMargin = (decimal).5 / 2.54M;
customerWorksheet.PrinterSettings.RightMargin = (decimal).5 / 2.54M;
customerWorksheet.PrinterSettings.TopMargin = (decimal).5 / 2.54M;
customerWorksheet.PrinterSettings.BottomMargin = (decimal).5 / 2.54M;
customerWorksheet.PrinterSettings.HeaderMargin = (decimal).5 / 2.54M;
customerWorksheet.PrinterSettings.FooterMargin = (decimal).5 / 2.54M;
}