hi!
you can set table style to style="border: 0px solid red;"
and ensure cells do not set any border styles and it should produce table with no borders
hi!
you can set table style to style="border: 0px solid red;"
and ensure cells do not set any border styles and it should produce table with no borders
hi!
I was wondering if there is a way to create shape or dynamically modify the color of a shape that is present in the template ?
There isn't a built-in way to do it. how are you modifying the XML directly? the XML of docx (and other office related XML) have to be well-formed, otherwise you get a broken document that can not open, so this is likely what is happening with your direct modifications.
what shapes are you trying to modify? just that we get an idea if it is something we can easily support. perhaps you can share a docx with the shapes you plan to dynamically modify, and what modifications do you expect to make.
this is fixed now, it is going to be part of next release
update: we improved the error message to include the most likely problematic text in the docx template. it will be part of next release
hi! thanks for the bug report, yes both syntax should work since this is what handlebars supports, we will check what is happening.
@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 value colsWidth: ["500px"]
after you fix this, the colsWidth works as expected.
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.
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
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.
- 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.
beforeRender
script, just check your data fields there and set empty space ''
directly there.docxHtml
with a handlebars subexpression like this {{docxHtml content=(normalizeEmpty html)}}
without needing a helper wrapper. then you just need to create the normalizeEmpty
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 your jsonToHtml
helper takes the json and converts it to an HTML string and you are good to go.