Skip to content

Spreadsheet Decoder is a library for decoding spreadsheets for ODS and XLSX files. (dart and flutter)

License

Notifications You must be signed in to change notification settings

dorym/spreadsheet_decoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spreadsheet Decoder

Build Status Coverage Status Pub version

Spreadsheet Decoder is a library for decoding and updating spreadsheets for ODS and XLSX files.

Usage

On server-side

import 'dart:io';
import 'package:spreadsheet_decoder/spreadsheet_decoder.dart';

main() {
  var bytes = File.fromUri(fullUri).readAsBytesSync();
  var decoder = SpreadsheetDecoder.decodeBytes(bytes);
  var table = decoder.tables['Sheet1'];
  var values = table.rows[0];
  ...
  decoder.updateCell('Sheet1', 0, 0, 1337);
  File(join(fullUri).writeAsBytesSync(decoder.encode());
  ...
}

On client-side

import 'dart:html';
import 'package:spreadsheet_decoder/spreadsheet_decoder.dart';

main() {
  var reader = FileReader();
  reader.onLoadEnd.listen((event) {
    var decoder = SpreadsheetDecoder.decodeBytes(reader.result);
    var table = decoder.tables['Sheet1'];
    var values = table.rows[0];
    ...
    decoder.updateCell('Sheet1', 0, 0, 1337);
    var bytes = decoder.encode();
    ...
  });
}

Features not yet supported

This implementation doesn't support following features:

  • annotations
  • spanned rows
  • spanned columns
  • hidden rows (visible in resulting tables)
  • hidden columns (visible in resulting tables)

For XLSX format, this implementation only supports native Excel format for date, time and boolean type conversion. In other words, custom format for date, time, boolean aren't supported and then file exported from LibreOffice as well.

License

The MIT License, see LICENSE.

About

Spreadsheet Decoder is a library for decoding spreadsheets for ODS and XLSX files. (dart and flutter)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 99.8%
  • Shell 0.2%