Closed nabramow closed 2 years ago
I would expect with code
createReport({
data: {images: [/*...*/]},
additionalJsContext: {
insertBase64String: async (myNestedVariable) => {
// Do something
},
},
});
and in template {#IMAGE insertBase64String(images[42])#}
this should work. It is near complete standard JS that is executed!
Thank you! I ended up needing to add come code related to our own codebase to pick the inner argument up as a variable (we trigger some behavior with certain variables).
I'm trying to insert an image into my document, and the argument for that image function will be another dynamic variable.
For example, this is what I want to add to my docx:
{#IMAGE insertBase64String({#myNestedVariable#})#}
When I try to run this, I get an error "Error executing command: IMAGE insertImage( Unexpected end of input". I assume because myNestedVariable hasn't evaluated yet.
I want to be able to access this dynamic variable in my
insertBase64String
function here:How can I do this? Do I have to create a separate variable with EXEC and reference it later in
insertImage
?