![]() Freeze the first row and the first column by passing (2, 2) to the eezePanes(int rowIndex, int columnIndex) method as the parameter. Select a cell to the right of the column and below the row you want to freeze.To freeze the first row and the first column, the selected cell should be cell (2, 2) – "B2". Workbook.saveToFile("output/FreezeFirstColumn.xlsx", ExcelVersion.Version2016) įreeze the First Row and the First Column Save the workbook to another Excel file using Workbook.saveToFile() method.Freeze the top row by passing (1, 2) to the eezePanes(int rowIndex, int columnIndex) method as the parameter.Get a specific worksheet using Workbook.getWorksheets().get() method.Load an Excel file using Workbook.loadFromFile() method.The following are the steps to freeze the first column using Spire.XLS for Java. To freeze the first column, we should select the cell (1, 2) – "B1" and freeze the column on the left. Workbook.saveToFile("output/FreezeTopRow.xlsx", ExcelVersion.Version2016) Worksheet sheet = workbook.getWorksheets().get(0) Workbook.loadFromFile("C:\\Users\\Administrator\\Desktop\\sample.xlsx") If you use Maven, you can easily import the JAR file in your application by adding the following code to your project's pom.xml file. ![]() The JAR file can be downloaded from this link. Freeze the First Row and the First Columnįirst, you're required to add the file as a dependency in your Java program.This tutorial provides the code examples for the following cases: Spire.XLS for Java provides the eezePanes(int rowIndex, int columnIndex) method to freeze all rows and columns above and left of the selected cell which is specified by the rowIndex and the columnIndex. This article will introduce how to freeze rows or/and columns in Excel using Spire.XLS for Java. For example, once the header row is frozen, we can easily find cells in the lower part of the worksheet without having to go back to the top to check the name of the header. This feature is helpful for viewing or editing data in a large worksheet. Excel Panes can be frozen to make certain rows or columns visible even when scrolling through the worksheet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |