Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Set Excel Default Row Height in Apache POI

I'm using Apache POI 3.7 with Spring MVC 3.1.

How to set excel default row height in apache POI?

I've tried sheet.setDefaultRowHeight((short) 100) and sheet.setDefaultRowHeightInPoints(100)

but that doesn't work.

Any suggestion for this problem?

Thank you.

like image 920
Fitrah M Avatar asked Feb 08 '12 02:02

Fitrah M


People also ask

How do I change the row height in Apache POI?

row. setHeightInPoints((2 * sheet. getDefaultRowHeightInPoints())); to set it (for example) to 2 characters high.

Does Apache POI support XLS?

The Apache POI library supports both . xls and . xlsx files and is a more complex library than other Java libraries for working with Excel files.

What is HSSF in Apache POI?

HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (. xlsx) file format. HSSF and XSSF provides ways to read spreadsheets create, modify, read and write XLS spreadsheets.


1 Answers

I use

    row.setHeightInPoints((2 * sheet.getDefaultRowHeightInPoints()));

to set it (for example) to 2 characters high.

like image 172
prule Avatar answered Oct 18 '22 15:10

prule