Great that you made it work with components!
The thing about cheerio is that by design they dont have access to calculated dimensions like outer width, but long time since i checked its api so i could be wrong
Great that you made it work with components!
The thing about cheerio is that by design they dont have access to calculated dimensions like outer width, but long time since i checked its api so i could be wrong
hi @nandihno
yes, this exception is on purpose, it is added there because nested tables are not supported yet, we don't have any priority for it at the moment, but check this for updates when it happens.
hi @msageryd
to me your 3 option sounds better to me, i don't understand how you 2 option will work, since the helper does not have access to DOM only js on server side i don't know how you replicate the same, because in your logic you are reading the calculated dimensions rendered by the browser, you don't have that on the server
It is ok, we will only render one item with the word template.
yes, this is expected, making it works with more than one item is not possible because of Docx limitations, even with MS Word you can not get a different header/footer per page, the header/footer of it is limited to mostly static content, and it allows just dynamic parts for special fields like page count, current page, etc.
About the word template closed in the footer, do you mean the new version still can not work ? or should I do anything ?
the new jsreport versions won't work with the same template you have, you need to change it to this:
docxList
is opened and closed in the same document, the footer part needs that you make an explicit reference to the data with {{Projects.0.Address1}}
for example
hi @AB-D
not sure if this is the issue but you have and old cli version, i think your cli is actually jsreport-cli
, however in most recent versions of jsreport the cli is now @jsreport/jsreport-cli
.
try to uninstall the old cli npm uninstall -g jsreport-cli
and install the new cli npm i -g @jsreport/jsreport-cli
and repeat the jsreport init
in new project to verify if this is the problem
hi!
do you mean like this? https://playground.jsreport.net/w/bjrmatos/skMfNHuD
using
in the html seems to work fine
your template can only work with just one item in the array, right? as long as i put another item (to try to produce 2 pages) it produces a corrupted document. does this reflect your usage? were you only using this template always with one item array to produce single-page docx?
@hexl84 thanks, with the export you send me i no longer get an error and can render normally.
i will check and investigate how we can let you generate the same output with newer versions of jsreport.
the problem is that what you were doing with docxList
worked just by coincidence, this helper is not expected to be open on the main document and then be closed on a footer, it is prone to errors, it can sometimes work, and sometimes don't, sometimes it will be even skip content of some other XML files, mostly because the order of the internal XML files in docx.
i think we are still not enforcing that helper calls are opened and closed in the same document, but we may consider it in the future if these kinds of "wrong" usage continue to appear for other users.
hi, i've tried to reproduce that this was working on 3.6.0 with the docx you sent me via email, but i get the same error i described above Cannot read properties of undefined (reading 'getElementsByTagName')
are you sure the version in which this works is 3.6.0? how are you installing jsreport? my test was creating a new project with "jsreport": "3.6.0" in package.json and imported this jsreport export 0_1712687918796_export.jsrexport
it is better if you send me a full export file so we can test the same (you can send me that to bjrmatos@gmail if the upload here gives you issues)
update: playground was updated to jsreport 4.3.1 yesterday so this is working also there, your original playground https://playground.jsreport.net/w/lukuser/UsE_lRgu now works