Suggestion: Templating and docx / pptx / xlsx Output Document Plugin
Hi team,
I have been thinking about this for some time and wherever I should try to script something together in Javascript or try to develop a plugin but I believe if anything - this should be part of the Joget Enterprise functionality and would take you guys probably only a short time to accomplish.
I am looking for a way to generate well designed docx / pptx / xlsx outputs that can use data from Joget forms or datalists.
To get the general idea, you might start with having a look at the implementation that ProcessMaker have. (hate to call out other solutions but in this aspect I think they have done a pretty decent job with template upload and customisation in TinyMCE)
But actually achieving this could be even simpler and more powerful by using a library like DocxTemplater:
- http://javascript-ninja.fr/docxtemplater/v2/examples/demo.html
- https://github.com/open-xml-templating/docxtemplater-build/tree/master/build
- https://github.com/open-xml-templating/docxtemplater#quickstart-in-the-browser
The idea is that the User can provide his/her own Template (with all the functions available in Word / PPT or Excel) which includes variables. These variables will be matched to Joget fields by the user. The library will replace the variables in the Templates with the actual data from Joget and voila - you will get a fully customized document / presentation / report. This particular library even supports grid data supplied as JSON to generate tables, multiple sections, etc.
The main challenge is accessing Joget grid data (at least for me - and hash variables cannot be used in that way yet). Otherwise I would have probably worked on a CustomHtml script already to do a POC.
A possible workaround (but this would involve some serious programming) would be to parse whole sections into XML to be able to use the DocxTemplater @rawXML variable. This seems rather impractical to me since I couldn't find anyone who was able to transform dynamic HTML into strict XML yet.
What do you guys think about this feature? Too hard to achieve or rather doable?
Cheers,
Eric