guigrpa / docx-templates

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

How to render table column data and then use its properties for below cells. Didn't found any example anywhere. #381

Open rdev06 opened 3 weeks ago

rdev06 commented 3 weeks ago

Expected:-

Year 1 Year 2 Year 3 Year 4
PSF 90 95 100 105
Annual rent 160,920.00 169,860.00 178,800.00 181,260.00
Tried: +++FOR pro IN proposed+++ Year +++$pro.year+++ +++END-FOR pro+++
PSF +++$pro.psf+++
Annual rent +++$pro.year+++

date: -


proposed: [
      { year: 1, psf: 90, rent: '160,920.00' },
      { year: 2, psf: 95, rent: '169,860.00' },
      { year: 3, psf: 100, rent: '178,800.00' },
      { year: 4, psf: 105, rent: '181,260.00' }
    ]
}`

### I tried too much but apart from year column data (This is coming correct), PSF and Annual rent is always the last one i.e 105 and 181,260.00 in first column that is wrong and rest all is empty.