tessera_ods 0.1.0 copy "tessera_ods: ^0.1.0" to clipboard
tessera_ods: ^0.1.0 copied to clipboard

OpenDocument (.ods) support for the tessera pivot-table engine: import a sheet as a data source, export a cube as a formatted sheet. Pure Dart.

tessera_ods #

OpenDocument Spreadsheet (.ods — LibreOffice Calc, Collabora, …) support for the tessera pivot-table engine:

  • OdsDataSource — a DataSource that streams the rows of one sheet, so a document can be inferred and imported like a CSV file (including in an isolate, via loadFactsInIsolate).
  • OdsCubeExporter — writes a CubeLayout (the expanded rows and columns exactly as shown) as a formatted sheet: merged group headers in the "rotated L" shape, level shading, bold summaries, frozen headers, localized labels through TesseraStrings, looks from the engine's CubeExportTheme (shared with tessera_xlsx).

Pure Dart, no Flutter dependency — works in Flutter apps, on servers and in command-line tools alike.

import 'package:tessera_ods/tessera_ods.dart';

final source = OdsDataSource.fromData(bytes, name: 'sales.ods');
final result = await loadFacts(source);

final ods = OdsCubeExporter(
  strings: TesseraStrings.forLanguage('hu')!,
  theme: CubeExportTheme.brand(primary: 0xFF00695C),
).export(cube.layout);

export returns the document as a Uint8List, ready to write to a file or hand to a download.

Example #

example/main.dart does the whole round trip from the command line — read example/sales.ods, infer and import, build a region/country × year/quarter cube with every region expanded, write it as sales_pivot.ods:

dart run example/main.dart [input.ods] [output.ods]

License #

MIT — see LICENSE. Author: László Zsolt Nagy.

0
likes
160
points
--
downloads

Documentation

API reference

Publisher

verified publishernagylzs.eu

OpenDocument (.ods) support for the tessera pivot-table engine: import a sheet as a data source, export a cube as a formatted sheet. Pure Dart.

Repository (GitHub)
View/report issues

Topics

#pivot-table #ods #opendocument #export #import

License

MIT (license)

Dependencies

archive, tessera, xml

More

Packages that depend on tessera_ods