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 .xlsx files via new Workbook(path) or new 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() and setTryRepairXml()

Cell Values and Formulas

  • Set typed values with cell.putValue() for String, int, double, boolean, and LocalDateTime
  • 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() as Object

Cell Formatting and Styles

  • Apply fonts, borders, fills, and alignment via the Style class from cell.getStyle()
  • Set bold, colour, and font name via Style.getFont()
  • Control alignment via HorizontalAlignment (LEFT, CENTER, RIGHT) and AlignmentValue
  • Set number formats using style.setCustom() or built-in NumberFormat patterns
  • Adjust row height and column width with getRows().get(n).setHeight() and getColumns().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 AutoFilterCustomFilter and FilterOperatorType
  • Apply top-10 filters via AutoFilterTop10

Data Validation and Conditional Formatting

  • Add whole-number, decimal, or list validation rules via sheet.getValidations().add()
  • Use ValidationType and OperatorType with formula bounds
  • Apply conditional formatting via FormatConditionCollection and FormatCondition

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 Hyperlink and HyperlinkCollection

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

FormatExtensionReadWrite
Excel Open XML.xlsx

Saving is currently limited to .xlsx.

See Also

 English