Siemienik / XToolset

Typed import, and export XLSX spreadsheet to JS / TS. Template-based create, render, and export data into excel files.
https://siemienik.com/docs/xtoolset
MIT License
173 stars 34 forks source link

[BUG] xlsx-renderer: When iterates on empty collection it leaves garbages #149

Open jacekkoziol opened 3 years ago

jacekkoziol commented 3 years ago

Using template with nested loops, the expected file is generated correctly however few renderer variables (in this case !# END_LOOP item and !# FINISH) are not removed from the generated file.

(@Siemienik EDIT): Reproduce:

sxr --model vm.json template.xlsx > result.xlsx
jacekkoziol commented 3 years ago

@Siemienik I have notice another issue, if the array in the view model data is empty, the variables of the loop section are not removed and they are just placed in the generated file. I'm attaching the source and result files:

Siemienik commented 3 years ago

Yesterday I added a utility which will helps me debug this issue (#134 #151). For now nothing blocks me and I start to fixing this bug ;)

jacekkoziol commented 3 years ago

@Siemienik It seems like the issue is caused by empty arrays on which we try perform the loop.

KouzanaFedi commented 1 year ago

Any update on this issue?

Siemienik commented 1 year ago

Thanks for refresh this topic, will investigate soon