What is autoSizeColumn?
autoSizeColumn(int column) Adjusts the column width to fit the contents. void. autoSizeColumn(int column, boolean useMergedCells) Adjusts the column width to fit the contents.
What is getPhysicalNumberOfRows?
Sheet.getPhysicalNumberOfRows() Returns the number of physically defined rows (NOT the number of rows in the sheet) This method will ignore empty rows, e.g. if a sheet last row is at row 7, but second row is empty, getPhysicalNumberOfRows() will return 6.
How do you freeze a row in Excel in Java?
To configure freeze panes, call the Worksheet class’ freezePanesmethod. THe FreezePanes method takes the following parameters: Row, the row index of the cell that the freeze will start from. Column, the column index of the cell that the freeze will start from.
How do I merge cells in Excel using Apache POI?
sheet = // existing Sheet setup int firstRow = 0; int lastRow = 0; int firstCol = 0; int lastCol = 2 sheet. addMergedRegion(new CellRangeAddress(firstRow, lastRow, firstCol, lastCol)); We can also use a cell range reference string to provide the merged region: sheet = // existing Sheet setup sheet.
What are HSSF and XSSF?
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.
What is Apache POI?
Apache POI, a project run by the Apache Software Foundation, and previously a sub-project of the Jakarta Project, provides pure Java libraries for reading and writing files in Microsoft Office formats, such as Word, PowerPoint and Excel.
What is POI library Java?
Apache POI is an open-source java library to create and manipulate various file formats based on Microsoft Office. Using POI, one should be able to perform create, modify and display/read operations on the following file formats.
What is CellRangeAddress?
CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol) Creates new cell range. CellRangeAddress(RecordInputStream in)
What is WorkbookFactory?
public abstract class WorkbookFactory extends java.lang.Object. Factory for creating the appropriate kind of Workbook (be it HSSFWorkbook or XSSFWorkbook), by auto-detecting from the supplied input.