回复 17楼SnailRun的帖子
不好意思,目前无法支持纸张大小的设置,可以结合打印方向和缩放完成类似效果:
- protected void Button2_Click(object sender, EventArgs e)
- {
- this.FpSpread1.OpenExcel(this.Server.MapPath("111.xlsx"));
- this.FpSpread1.ActiveSheetView.AllowPage = false;
- for (int c = 0; c < FpSpread1.ActiveSheetView.Charts.Count; c++)
- {
- if (FpSpread1.ActiveSheetView.Charts[c].PageIndex == 1)
- {
- FpSpread1.ActiveSheetView.Charts[c].PageIndex = 0;
- FpSpread1.ActiveSheetView.Charts[c].Top = new Unit(FpSpread1.ActiveSheetView.Charts[c].Top.Value + 10 * 21); // 10 is PageSize, 21 is row height
- }
- }
- //this.FpSpread1.ActiveSheetView.Cells[0, 19].Text = "test";
- PrintInfo pi = new PrintInfo();
- pi.ZoomFactor = 0.8f;
- pi.Orientation = PrintOrientation.Landscape;
- this.FpSpread1.ActiveSheetView.PrintInfo = pi;
- this.FpSpread1.SavePdfToResponse("test.pdf");
- }
复制代码 |