numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
18 stars 6 forks source link

Exporting a table with multiple head rows to XLS does not work #78

Closed numeredev closed 1 year ago

numeredev commented 1 year ago

DESCRIPTION

Describe the bug Exporting a table, which contains multiple head rows (head rows containing a line break character), into an XLS file using the table viewer or the export command does not work but results in an app hang.

To Reproduce Steps to reproduce the behavior:

  1. Create a table with multiple table head rows
  2. Enter export TABLE() -set file=FILENAME.xls
  3. See error

Expected behavior The table should be saved to a file.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The problem boils down to a typo in void XLSSpreadSheet::writeFile(), where a while loop replaces '\n' with (char)10 which is identical to '\n'. This should instead be (char)13 as can be seen in the opposite function void XLSSpreadSheet::readFile(). The used std::string::replace() seems also have some problems as two chars are replaced instead of one?

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST