can you try to upload the xlsx files again? it would be great if you add the data you use too.
if you like you can also send me those files at bjrmatos@gmail.com
can you try to upload the xlsx files again? it would be great if you add the data you use too.
if you like you can also send me those files at bjrmatos@gmail.com
hi @lennykey
Before this was working before jsReport 4.0.6
do you mean before 4.6.0? right?
{{lookup localize "months" (localizationFolder) settlementMonth}}
hmm i am not even sure why using the lookup worked previously here, that way you use the lookup makes use of 4 parameters, even though i think lookup only works with 2 (according to handlebars docs).
{{localize (concat "months." settlementMonth) (localizationFolder)}}
This looks good, and it is the correct way to use the localize helper, though i am not sure why you need to wrap the localizationFolder in parentheses (localizationFolder), if it is just a data variable you should not need to use handlebars sub-expressions here.
hi! yes, it is not possible to use ESM inside the sandbox, it is mainly because of some limitations in the implementation of sandbox (vm module and vm scripts).
we are tracking the progress of it in this issue, there were some changes in node that will likely help with making ESM modules to work in sandbox, however we have not yet evaluated the full history.
this change will likely require a major version bump in jsreport so we are still in the process of planning the next major release, and when we are on that we will fully check if ESM is possible right now or not yet given the current nodejs features.
hi!!
you should be able to execute the cli without the global installation by doing any of the following methods:
(all methods assume you execute the command from the root of your project)
npx jsreport <command>node node_modules\.bin\jsreport <command>if this does not work, please share more details, like:
@ValentinCerfaux yes, the fix is going to be part of next release.
thank you @ValentinCerfaux, i can replicate the problem with your export, we are going to take a look.
using the {{#if }} in this way does not work in xlsx, in Docx it works because the definition of the content there is different from how cells definitions are done. you can use the {{#if }} in xlsx only if the start end end of the block calls are in the same cell.
however this would be nice to support, i have opened new issue to support it, you can subscribe there for updates
@bjarnesc yes, let us know if you get to have a sample ready
hi @bjarnesc
as I understand from the documentation, if jsreport detects a table of content, it automatically tries to update this. As good as an automated update would be, this seems to be a bit hacky and is not working properly for my template.
maybe we can try to fix the automatic update for your template. if you share your entities we can take a look.
My solution would be to just not use page numbers and to keep the toc as it is in the template, because there is no generated headings. However I do not seem to find a way that the toc just stays the same as in the template. I tried setting {{docxTOCOptions updateFields=false}} in the table header but this did not work. Is there any solution for this?
no way to disable the automatic sync of TOC, the updateFields is an option for another purpose, it is described in the docs. i have opened a new issue to add an option to disable the automatic sync, you can subscribe there for updates.
hi @ValentinCerfaux can you share an export of your template? that would help to verify what is wrong.
FYI the issue should be fixed on the latest jsreport 4.10.1 release
it works for me on latest jsreport (4.10.0), what version are you using? if using a different version, ensure you are using latest jsreport.
hi! if you want to preserve the image of the docx template you need to force an error, the failurePlaceholderAction will do its job when detecting that there is an error loading the image. to force the error you can set your logoBase64 to some invalid url like https://error.
it looks inconvenient to do it this way, but maybe in the future we will allow to pass the null value.
hi! it is not enough to put the handlebars in the document, you have to follow some specific steps.
Prepare image placeholder using word - place any image to the desired position and format it to your needs.
Select image, select Word tab "Insert", click on "Bookmark and create one
Right click image and click "Hyperlink"
Click bookmark and select previously created bookmark
Click ScreenTip still on the "Insert Hyperlink" modal.
Fill the docxImage helper call {{docxImage src=myDataURIForImage}}
Hit ok and close the hyperlink dialog. Now if you hower the image you should see the docxImage helper call
Run the template with myDataURIForImage prop in the input data and you should see the image replaced in the output.
here is an example
FYI we have included changes to make the section breaks to work. it is available with jsreport 4.10.0, you can do a test of it.
thanks for the heads up, i am going to take a look
i just replicated what you were trying to do on your first comment (from the screenshot), and i see it works. see example here: https://playground.jsreport.net/w/bjrmatos/1TEWLWcV
doesn't this cover your use case?
hi!
it seems the problem is how your loops are generating the rows
in your first each you are generating: R2, R3 ... R6
the second each you are generating: R2, R3 ... R7
the third each you generate: R2, R3, R4
basically you are generating duplicated rows, and because of that when you see the file, the preview tries to self-repair the duplicated rows by given them new indexes, so that is why you your content being generated at different rows.
there are a lots of ways you can fix this, but the most simple i think is to group your data and in single loop generate all the rows that you need

this is how it looks for me using MS Excel on macOS. text truncated as expected because you are using a custom width in the HTML. i don't know why it looks different to you, is this MS Excel from Windows?
can you attach these as an export file? if the attachment here does not work send me the file via email to bjrmatos@gmail.com