回复 1楼dc22wt的帖子
设置代码如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
- FarPoint.Win.Spread.SmartPrintRulesCollection prules = new FarPoint.Win.Spread.SmartPrintRulesCollection();
- // ... use best fit of columns and rows
- printset.BestFitCols = true;
- printset.BestFitRows = true;
- // ... or check by page size
- printset.SmartPrintPagesTall = 1;
- printset.SmartPrintPagesWide = 1;
- // ... or use the rules defined
- prules.Add(new FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None));
- prules.Add(new FarPoint.Win.Spread.LandscapeRule(FarPoint.Win.Spread.ResetOption.Current));
- printset.SmartPrintRules = prules;
- printset.UseSmartPrint = true;
- //设置居中打印
- printset.Centering = FarPoint.Win.Spread.Centering.Both;
- // Assign the printer settings to the sheet and print it
- fpSpread1.Sheets[0].PrintInfo = printset;
- fpSpread1.PrintSheet(0);
- }
复制代码 |