你好,
1.问题中所提到的 “列头背景色和立体感” 为 ColumnHeader 的 Shadow,在打印之前添加:
- FarPoint.Win.Spread.PrintInfo test= new FarPoint.Win.Spread.PrintInfo();
- test.ShowShadows = false;
复制代码 2.bestfitcols 属性是以 表单中该列中最大单元格文本宽度为依据,而不是以 ColumnHeader 中的文本宽度为依据,所以会出现显示不全的情况。你可以添加以下代码进行尝试:
- TextCellType tc = new TextCellType();
- tc.WordWrap = false;
- fpSpread1.ActiveSheet.ColumnHeader.Columns[0].CellType = tc;
- this.fpSpread1.Sheets[0].ColumnHeader.Columns[0].Label = "TestTestTestTestTestTestTest";
- this.fpSpread1.Sheets[0].Columns[0].Width = this.fpSpread1.Sheets[0].ColumnHeader.Columns[0].GetPreferredWidth();
- this.fpSpread1.Sheets[0].Cells[0, 0, 5, 5].Value = 10;
- FarPoint.Win.Spread.PrintInfo printinfo = new FarPoint.Win.Spread.PrintInfo();
- printinfo.PrintToPdf = true;
- printinfo.ShowShadows = false;
- printinfo.PdfFileName = @"E:\test.pdf";
- this.fpSpread1.Sheets[0].PrintInfo = printinfo;
- fpSpread1.PrintSheet(0);
复制代码 |