xlsxwriter library
A native, fast, low-memory Excel .xlsx writer for Dart.
This library is an FFI binding to
libxlsxwriter by John
McNamara, compiled from vendored C source at build time. It targets the
report- and export-generation use case: writing spreadsheets quickly and
with low memory. It does not read existing files; for that use the
excel or
spreadsheet_decoder
packages.
import 'package:xlsxwriter/xlsxwriter.dart';
void main() {
final workbook = Workbook('report.xlsx');
final sheet = workbook.addWorksheet('Summary');
final header = workbook.addFormat()..bold();
sheet.writeString(0, 0, 'Item', header);
sheet.writeString(0, 1, 'Amount', header);
sheet.writeString(1, 0, 'Widgets');
sheet.writeNumber(1, 1, 1250);
workbook.close();
}
Classes
- Chart
- A chart created with Workbook.addChart and placed on a sheet with Worksheet.insertChart.
- Format
- Cell formatting, obtained from Workbook.addFormat.
- Workbook
-
An Excel
.xlsxworkbook, backed by libxlsxwriter. - Worksheet
- A single sheet within a Workbook, obtained from Workbook.addWorksheet.
Enums
- CellBorder
- Cell border style, applied with Format.border.
- ChartType
- The kind of chart created with Workbook.addChart.
- ConditionalCriteria
- The comparison a Worksheet.conditionalCell rule applies to each cell's value.
- HorizontalAlignment
- Horizontal cell alignment, applied with Format.align.
- Underline
- Underline style, applied with Format.underline.
- VerticalAlignment
- Vertical cell alignment, applied with Format.verticalAlign.
Exceptions / Errors
- XlsxWriterException
- Thrown when libxlsxwriter reports an error.