excel icon indicating copy to clipboard operation
excel copied to clipboard

Merged Cell Styles

Open johncharris opened this issue 1 year ago • 1 comments

Settings Merged Cell styles doesn't appear to work.

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

Future main(List<String> args) async {
  var excel = Excel.createExcel();
  var sheet = excel[excel.sheets.keys.first];

  var aptosDisplayStyle = CellStyle(fontFamily: 'Aptos Display', bold: true);

  sheet.merge(CellIndex.indexByString("A1"), CellIndex.indexByString("B2"),
      customValue: const TextCellValue("90"));
  sheet.setMergedCellStyle(CellIndex.indexByString("A1"),
      aptosDisplayStyle.copyWith(rotationVal: 90));

  await File("C:\\Users\\johnc\\Documents\\output_merge_test.xlsx")
      .writeAsBytes(excel.encode()!);
}

image

johncharris avatar Dec 29 '23 15:12 johncharris

Setting the style on the first cell does work.

johncharris avatar Dec 29 '23 15:12 johncharris