回复 9楼lzechoca的帖子
测试了,截图如供8楼的。
我打印函数是添加了 6楼的两行代码。
- private void btnPrint_Click(object sender, EventArgs e)
- {
- //隐藏表头
- fpSpread1.ActiveSheet.ColumnHeader.Visible = false;
- fpSpread1.ActiveSheet.RowHeader.Visible = false;
- //fpSpread1.bor
- //SmartPrintRulesCollection printrules = new FarPoint.Win.Spread.SmartPrintRulesCollection();
- //printrules.Add(new FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None));
- //printrules.Add(new FarPoint.Win.Spread.LandscapeRule(FarPoint.Win.Spread.ResetOption.None));
- //printrules.Add(new FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.All, 1.0f, .4f, .2f));
- PrintInfo info = new PrintInfo();
- info.RepeatRowStart = 0; //开始重复的rowIndex--head
- info.RepeatRowEnd = 13; //结束重复的rowIndex---head
- info.Preview = true;
- info.ShowBorder = false;
- info.Margin = new PrintMargin(50, 50, 50, 50, 50, 50);
- // info.Orientation = PrintOrientation.Landscape;//横向打印
- //info.BestFitRows = true;
- //info.BestFitCols = true;
- //info.SmartPrintRules = printrules;
- //info.UseSmartPrint = true;
- fpSpread1.ActiveSheet.PrintInfo = info;
- fpSpread1.PrintSheet(fpSpread1.ActiveSheetIndex);
- //fpSpread1.ShowPageSetup(fpSpread1.ActiveSheet, false, true);
- }
复制代码 |