Features
Feature Overview
This guide summarizes the spreadsheet processing capabilities available in Aspose.Cells FOSS for Java, including workbook management, cell formatting, filtering, validation, and document properties.
Aspose.Cells FOSS for Java provides the following capabilities for Java 17+ applications.
Workbook and Worksheet Management
- Create new workbooks with
new Workbook()using the try-with-resources pattern - Load existing
.xlsxfiles vianew Workbook(path)ornew Workbook(path, options) - Access worksheets via
getWorksheets().get(index)or by name - Rename worksheets with
setName(), add and remove sheets, set the active sheet - Control worksheet visibility and tab colour via
WorksheetViewModel - Enable repair mode with
LoadOptions.setTryRepairPackage()andsetTryRepairXml()
Cell Values and Formulas
- Set typed values with
cell.putValue()forString,int,double,boolean, andLocalDateTime - Inspect value type via
CellValueType:STRING,NUMBER,BOOLEAN,DATE_TIME,FORMULA,BLANK - Store formula strings with
cell.setFormula()— recalculated by Excel on open - Access string representation via
cell.getStringValue() - Read raw value via
cell.getValue()asObject
Cell Formatting and Styles
- Apply fonts, borders, fills, and alignment via the
Styleclass fromcell.getStyle() - Set bold, colour, and font name via
Style.getFont() - Control alignment via
HorizontalAlignment(LEFT,CENTER,RIGHT) andAlignmentValue - Set number formats using
style.setCustom()or built-inNumberFormatpatterns - Adjust row height and column width with
getRows().get(n).setHeight()andgetColumns().get(n).setWidth()
AutoFilter
- Set an AutoFilter header range with
ws.getAutoFilter().setRange() - Add filter columns via
getFilterColumns().add(index) - Define custom filter criteria via
AutoFilterCustomFilterandFilterOperatorType - Apply top-10 filters via
AutoFilterTop10
Data Validation and Conditional Formatting
- Add whole-number, decimal, or list validation rules via
sheet.getValidations().add() - Use
ValidationTypeandOperatorTypewith formula bounds - Apply conditional formatting via
FormatConditionCollectionandFormatCondition
Page Setup and Worksheet Protection
- Configure print settings with
PageSetup: paper size, orientation, fit-to-page, print area - Toggle gridlines and headings for printing via
PrintOptionsModel - Protect worksheets and fine-tune permissions using
WorksheetProtectionModel - Store hyperlinks in worksheets via
HyperlinkandHyperlinkCollection
Document Properties
- Access and set workbook document properties via
workbook.getDocumentProperties() - Set author, title, and other metadata fields
- Inspect load diagnostics via
workbook.getLoadDiagnostics().getIssues()
Supported Formats
| Format | Extension | Read | Write |
|---|---|---|---|
| Excel Open XML | .xlsx | ✓ | ✓ |
Saving is currently limited to .xlsx.