this is fixed now, it is going to be part of next release

BORIS MATOS MORILLO
@bjrmatos
Posts made by bjrmatos
-
RE: Upgrade to 4.8 issue: Passing string to function in excel needs to be wrapped in apostrophes.
-
RE: Informative error message for docx templates
update: we improved the error message to include the most likely problematic text in the docx template. it will be part of next release
-
RE: Upgrade to 4.8 issue: Passing string to function in excel needs to be wrapped in apostrophes.
hi! thanks for the bug report, yes both syntax should work since this is what handlebars supports, we will check what is happening.
-
RE: Upgrade Issue : Column widths are not correct when using pptxTable vertical=true (^4.5.0)
@WadeBenz using
colsWidth=["500px"]
is not a valid way to pass an array to a handlebars helper, in the pptx you need to have something like this:colsWidth=colsWidth
, and your data should contain the valuecolsWidth: ["500px"]
after you fix this, the colsWidth works as expected.
-
RE: XLSX Handlebar, am I able to dynamically display columns?
okay that is what i figured when playing around with the xlsx recipe. just to clarify, this recipe allows generating dynamic cells from EITHER horizontal or vertical but NOT both?
yes, we recently introduced the support for vertical loop, so it is matter of time to introduce the mode to produce cells in both directions and have fully dynamic cells support.
-
RE: XLSX Handlebar, am I able to dynamically display columns?
hi! this is not possible right now.
to be able to do what you want, we will need to generate dynamic cells from both directions, right now you can generate cells horizontally (using the each loop, just like in your example), and generate cells vertically (using
{{#each items vertical=true}}
and placing the end of loop vertically)support for generating the cells from both directions is not yet possible, you can subscribe here for updates about this feature, we will try to increase the priority for it, but no promises
-
RE: Customize Built-in helpers (docx)
yes, i get that the template gets too verbose, but we always choose to throw error on invalid usage. this way you have the reason why something does not produce the expected output while developing the template.
your use case is exactly why scripts exists, if there is some transformation or normalization you need to do to your data, beforeRender script is the place, and as far i can see your use case is well covered by just using the script.
allowing to wrap the docxHtml will be a complex task, and not sure yet if possible, because we need to know the paragraph containing the docxHtml call, and without the convention of checking for an exact name like
docxHtml
we will need to take more complex approaches. -
RE: Customize Built-in helpers (docx)
- If the data is null docxHtml return error, so for start return null or blank and do not fail the entire document
right now, if you pass null to the
content
hash parameter of docxHtml it throws an error, so you mean that you don't want that, right? you want instead for the render to continue with just an empty part. if that is the case you have two options that does not involve wrapping a helper.- you can normalize your data in a
beforeRender
script, just check your data fields there and set empty space''
directly there. - if you don't want to alter your data in script then you can call
docxHtml
with a handlebars subexpression like this{{docxHtml content=(normalizeEmpty html)}}
without needing a helper wrapper. then you just need to create thenormalizeEmpty
function normalizeEmpty (value) { return value == null ? '' : value }
try to create html for a table from json and then embed it in the word template
i think for this case you can also use a handlebars subexpression, to do what you want,
{{docxHtml content=(jsonToHtml json)}}
, you just need to ensure yourjsonToHtml
helper takes the json and converts it to an HTML string and you are good to go. -
RE: Customize Built-in helpers (docx)
hi!
generally speaking it depends, sometimes we check for the specific call in the document, so we expect the same name of the helper to be there. in the case of
docxHtml
we search for the exact call to happen in the document, so if you wrap it with your own, it wont work because we wont be able to find the call.what is your use case for this? what do you want to do in your own wrapper?
-
RE: Rendering issue with v3 and v4 , working fine with v2
hi! please share the template that it is giving you these errors