回复 18楼study1990的帖子
测试代码:
- this.FpSpread1.CommandBar.ShowPDFButton = true;
- this.FpSpread1.Sheets[0].PageSize = 40;
- this.FpSpread1.Sheets[0].ColumnCount = 50;
- this.FpSpread1.Sheets[0].RowCount = 30;
- for (int i = 0; i < 50; i++)
- {
- for (int j = 0; j < 30; j++)
- {
- this.FpSpread1.Sheets[0].Cells[j, i].Text = i.ToString()+"列"+j.ToString()+"行";
- }
- }
- FarPoint.Web.Spread.PrintInfo prinf = new FarPoint.Web.Spread.PrintInfo();
- FarPoint.Web.Spread.SmartPrintRulesCollection prules = new FarPoint.Web.Spread.SmartPrintRulesCollection();
- prules.Add(new FarPoint.Web.Spread.SmartPaperRule(FarPoint.Web.Spread.ResetOption.None));
- prinf.SmartPrintRules = prules;
- prinf.UseSmartPrint = true;
- FpSpread1.ActiveSheetView.PrintInfo = prinf;
复制代码 |