回复 3楼luoyefeng的帖子
你可以试一试以下方法,主要是通过一个临时的Spread来完成打印:
- FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo();
- pi.ShowColor = false;
- pi.Preview = true;
- pi.ShowPrintDialog = true;
- SheetView view = FarPoint.Win.Serializer.LoadObjectXml(fpSpread1.ActiveSheet.GetType(), FarPoint.Win.Serializer.GetObjectXml(fpSpread1.ActiveSheet, "CopySheet"), "CopySheet") as SheetView;
- view.Cells[0, 0, view.RowCount-1, view.ColumnCount-1].ResetBackColor();
- view.Cells[0, 0, view.RowCount-1, view.ColumnCount-1].ResetForeColor();
- view.PrintInfo = pi;
- FpSpread spread = new FpSpread();
- spread.Sheets.Add(view);
- spread.PrintSheet(0);
复制代码 |