回复 4楼ling121211的帖子
你好,
避免打印行列头和 Sheet1 部分方法如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- FarPoint.Web.Spread.PrintInfo info = new FarPoint.Web.Spread.PrintInfo();
- info.ShowColumnFooter = PrintHeader.Hide;
- info.ShowColumnHeader = PrintHeader.Hide;
- info.ShowRowHeader = PrintHeader.Hide;
- FpSpread1.ActiveSheetView.PrintInfo = info;
- FpSpread1.SavePdf(this.Server.MapPath("pdffile.pdf"));
- }
- protected void FpSpread1_PrintSheet(object sender, PrintEventArgs e)
- {
- if (e.Header)
- {
- e.Content = "";
- }
- }
复制代码
PrintInfo 在打印到 PDF 文件时全部启作用,通过 Spread CommandBar Print 按钮打印时只是部分属性启作用。 |