AligningCells - Apache POI Excel File Example

Q

What is AligningCells example in the Apache POI package? How to run AligningCells example?

✍: FYIcenter.com

A

AligningCells example in the Apache POI package is created by Cristian Petrula. It shows how various alignment options work when generating *.xlsx files.

AligningCells example uses the XSSF (OpenXML SpreadSheet Format) API, which supports Excel files in *.xlsx format only.

Here is the command to run AligningCells to generate a sample *.xlsx file.

C:\fyicenter>c:\local\jdk-1.8.0\bin\java 
   -cp .;C:\local\poi-3.15\poi-examples-3.15.jar;
         C:\local\poi-3.15\poi-3.15.jar;
         C:\local\poi-3.15\poi-ooxml-3.15.jar;
         C:\local\poi-3.15\ooxml-lib\xmlbeans-2.6.0.jar;
         C:\local\poi-3.15\lib\commons-collections4-4.1.jar;
         C:\local\poi-3.15\poi-ooxml-schemas-3.15.jar 
   org.apache.poi.xssf.usermodel.examples.AligningCells   

If you open the output file, xssf-align.xlsx, in Excel, you will see text in different cells are aligned differently:

Apache POI Excel File Example - AligningCells
Apache POI Excel File Example - AligningCells

 

XLSX2CSV - Apache POI Excel File Example

ScatterChart - Apache POI Excel File Example

Apache POI Examples for Excel Files

⇑⇑ FAQ for Apache POI (Poor Obfuscation Implementation)

2017-03-11, 1364🔥, 0💬