PrintInfo printInfo = new PrintInfo();
printInfo.ShowBorder = false; // 是否显示表单的四周打印边界
printInfo.ShowColor = false; // 是否显示颜色
printInfo.ShowColumnHeader = PrintHeader.Hide; // 是否显示列标题
printInfo.ShowGrid = false; // 是否显示网格线
printInfo.ShowPrintDialog = false; // 是否显示打印对话框
printInfo.ShowRowHeader = PrintHeader.Hide; // 是否显示行标题
printInfo.ShowShadows = false; // 是否打印标题阴影
printInfo.EnhancePreview = false; // 是否显示打印预览对话框
printInfo.RepeatRowStart = startrepeatRow;
printInfo.Footer = sheet.PrintInfo.Footer;
printInfo.Header = sheet.PrintInfo.Header;
printInfo.RepeatRowEnd = endRepeatRow;
if (isprint)
{
printInfo.PrintToPdf = false;
printInfo.Printer = printerName;
}
else
{
printInfo.PrintToPdf = true;
printInfo.PdfFileName = fileName;
printInfo.Printer = "Microsoft Print to PDF";
}
printInfo.ZoomFactor = 0.95f;//缩放比例
printInfo.Margin = new PrintMargin(32,47,15,47,9,18);
sheet.PrintInfo = printInfo;
fpSpread.PrintSheet(sheet); |