Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

New Post: Build DOCX files from scratch

$
0
0
I've been using NPOI (1.2.5) for a while to make XLS files, and I recently discovered the NPOI 2.0.6 which I would like to use to build DOCX files from scratch.

I've been looking for a XWPF styled table example, and found very little, I got the example Simple Table working, and found a styled Table example from POI, but calling, <tcpr.tcPrChange = new CT_TcPrChange();> whether, I make any additional calls to the tcpr object or not (<tcpr.AddNewShd().fill = "A7BFDE";>), causes the Table to render BADLY (WHOLE CELL IS BLACK). I would like to change the fill color:
tcpr.tcPrChange = new CT_TcPrChange();
tcpr.AddNewShd().fill = "A7BFDE";

The following is a summary of my success and failures:

XWPF Success:
  • Create Paragraphs
  • Set Font-Family
  • Set Font-Size
  • Set Font-Bold
  • Set Text
  • Set Run-Color
  • Create Table
  • Access Table-Cell-Paragraph
  • Create Runs in Table-Cells
  • SetInsideVBorder & SetInsideHBorder
XWPF Fail:
  • AddPicture
  • Set Table-Width
  • Set Table-Column-Width
  • Set Table-Row-Height
  • Set Table-Cell-Background-Color
  • Set Table-SetOutsideVBorder & Table-SetOutsideHBorder
  • Set Page-Header/Footer
  • Set Page-Orientation-Landscape (maybe not event supported in POI yet?)
Are any or all of these expected to work at this time?
If so, where can I find example code for each?

Thanks

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>