回复 1楼hptj的帖子
需要设置 Border 的宽度才能导出,代码如下:
- private void PrehandleHeader()
- {
- HeaderFooter header = _currentSection.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header);
- if (header != null)
- {
- header.Activate();
- header.Selection = new Selection(0, -1);
- header.Selection.FontName = _fontName;
- foreach (Table table in tc.Tables)
- {
- foreach (TableCell cell in table.Cells)
- {
- tc.Selection.Start = cell.Start;
- tc.Selection.Length = cell.Length;
- tc.Selection.FontName = _fontName;
- tc.Selection.Length = 0;
- cell.CellFormat.BottomBorderWidth = 1;
- cell.CellFormat.LeftBorderWidth = 1;
- cell.CellFormat.RightBorderWidth = 1;
- cell.CellFormat.TopBorderWidth = 1;
- }
- }
- header.Deactivate();
- }
- }
- private void PrehandleTable()
- {
- foreach (Table table in tc.Tables)
- {
- foreach (TableCell cell in table.Cells)
- {
- tc.Selection.Start = cell.Start;
- tc.Selection.Length = cell.Length;
- tc.Selection.FontName = _fontName;
- tc.Selection.Length = 0;
- cell.CellFormat.BottomBorderWidth = 1;
- cell.CellFormat.LeftBorderWidth = 1;
- cell.CellFormat.RightBorderWidth = 1;
- cell.CellFormat.TopBorderWidth = 1;
- }
- }
- }
复制代码 |