guigrpa / docx-templates

Template-based docx report creation
MIT License
882 stars 145 forks source link

Dynamic table columns feature #344

Closed SuchiraD closed 5 months ago

SuchiraD commented 8 months ago

Added looping for table columns.

Eg: Dynamic columns

image image

Dynamic rows & dynamic columns

image image
SuchiraD commented 8 months ago

Hey @jjhbw, I have made few changes to enable dynamic generation of table columns. Please suggest any test cases that I should add, which will cover any edge case if there is any.

jjhbw commented 8 months ago

Good to see someone finally took a stab at this! Thanks a lot for the effort.

Sorry for taking so long to respond to this, I have been meaning to test it against a few private test cases first to ensure we're not introducing regressions (the docx spec is terrifying, as you may know very well by now haha).

SuchiraD commented 8 months ago

Good to see someone finally took a stab at this! Thanks a lot for the effort.

Sorry for taking so long to respond to this, I have been meaning to test it against a few private test cases first to ensure we're not introducing regressions (the docx spec is terrifying, as you may know very well by now haha).

Hahaha.... absolutely. It is too complicated.

Yes please. Its always better to look at this in another perspective. Maybe I could have been biased only for the repetition of table columns.

SuchiraD commented 6 months ago

Hi @jjhbw, Do you have any idea on what scenarios should I write more test cases to?

jjhbw commented 5 months ago

Working on your PR now.

Sidenote:

Ran jest --updateSnapshot to fix error_handling.test.ts.snap

Note that these snapshots weren't broken, they were just geared towards Node 20.x, which has slightly different error messages than older versions.

jjhbw commented 5 months ago

Thanks! Looks great.

Merged offline 13b40c37d75d613351ea00b6d7dda0b64cc9c406