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
hi @lukuser
i believe this should work, take a look
https://playground.jsreport.net/w/bjrmatos/DxCB_tRG
i have modified the pptx to have this call at the top {{pptxSlides (chunksBySuites buildings)}}
and then just added the chunksBySuites
helper
function* _chunk(buildings, maxSuites) {
for (let i = 0; i < buildings.length; i ++) {
const { suites, ...rest } = buildings[i]
for (let j = 0; j < suites.length; j += maxSuites) {
const newBuilding = { ...rest }
newBuilding.suites = suites.slice(j, j + maxSuites)
yield newBuilding;
}
}
}
function chunksBySuites(buildings) {
const maxSuites = 3
return [..._chunk(buildings, maxSuites)]
}
hi! this is not possible at the moment, i will add it to the backlog, thanks
yes, it was released, this is the result of jsreport 4.3.1
in older versions (4.2.0) it was producing a broken document
what is the output you are seeing now?
thank i have a docx now, i am putting this in my backlog to check, will switch to it as soon as i finish with another task about docx.
seem that the upload failed, you can retry again, or send me the file at bjrmatos@gmail.com
hi! can you share an export of your template?
I've tried to replicate that this works on 3.6.2 but i get this error
i don't know what can be the problem, as mentioned, the full docker image work for us, we are using it with docker for windows/macos and also running it on linux directly, so it is working fine.
if this issue only happens when you are building your own image, then something must be wrong there, but we can not know without testing a complete docker image.
hi! i don't see any steps you do that can cause an issue
what if you test the jsreport/jsreport:4.3.0-full
directly? check if Chrome works there
what is the host in which you are running this? i mean if you are using Docker for Windows, Docker for Macos or just running Docker directly on linux
the reason chrome may not work can be a combination of the host and some steps in the dockerfile, so it is not clear what can be the issue for you
@xGreylee this feature was landed on jsreport 4.3.0 check the updated docs for it
Each image generated by docxImage generates a bookmark that points to the new image, customizing the bookmark (with bookmarkName option) will allow for other images to be able to create hyperlinks that target this specific image (just make sure to make the hyperlink of an image dynamic too with handlebars, the requirement is that the target resolves to #bookmarkName). using these two features, the custom bookmark name and the dynamic hyperlink target will allow to achieve dynamic linking between images in the document.