Dynamic colums and rows in docxTable in docx recipe
-
Hey @jan_blaha @bjrmatos
I'm trying to use dynamic rows and columns in docxTable from docx recipe.
I have data like this https://playground.jsreport.net/w/Heplinesss_17/IJk3whYb and I want output like thisBasically I want three fixed colums and row should be depended on data. I have one array of students and their information should be display in three columns
If you guys can help me out, that will be great.
Thanks!
-
You can for example group the items in the array using a custom helper
https://playground.jsreport.net/w/anon/Rt30s3k6
-
Thanks @jan_blaha
-
Hey @jan_blaha
Thanks for the solution but having one query,
Whenever we provide data into multiple of 3 it's working fine. but when we provide 4, 5, 7.. number of data it's throwing error like docxImage helper requires src parameter to be setyou can check the issue here
Is there any solution for that?
Thanks!
-
Then you should use
{{#if}}
condition and skip the content for the cell you don't have the data for.
For example like this
https://playground.jsreport.net/w/anon/quGxSzZr
-
Thanks @jan_blaha