salvois / LargeXlsx

A .net library to write large Excel files in XLSX format with low memory consumption using streamed write.
Other
204 stars 34 forks source link

Excel reporting file as faulty, when colspan larger than 2 used on any cell - from 1.9.0 #40

Closed tomaszlis86 closed 9 months ago

tomaszlis86 commented 9 months ago

Hi there, We have discovered issue occurring in newest version (1.9.0).

When you prepare an xlsx with cell, using colspan larger than 2, Excel reports it as faulty and intends to repair it upon opening. This problem wasn't present in previous version (1.8.0). We are using you nuget package in solution that runs on linux server (Debian 11 currently).

Belowe you have test code and example excel file.

  using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Write))
  using (var xlsxWriter = new XlsxWriter(stream))
  {

      xlsxWriter.BeginWorksheet("Test");
      xlsxWriter.BeginRow();
      xlsxWriter.BeginRow();

      xlsxWriter.Write("");
      xlsxWriter.Write("Broken", null, 3);

  }

testExcel_20240124_175629.xlsx

salvois commented 9 months ago

Hi @tomaszlis86 , thanks for reporting this. I hope I can have a look during this weekend.

scoroop commented 9 months ago

you saved my day with this fix :D