1
0
-1

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:

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

 

 

    CommentAdd your comment...

    6 answers

    1.  
      3
      2
      1

      Hi,

      I would add https://docxtemplater.com/ 

      This library generate MS word document.

      1. Eric

        Docxtemplater is promising as well - they can also handle pptx.

      CommentAdd your comment...
    2.  
      3
      2
      1
      1. Eric

        Hi Anders, Thanks - yes I believe that this would be a pretty cool feature and can be used to make it easy for business users to modify their own report look and feel / surrounding fixed content like contracts. I am not that great with Java but the links seem to be able to achieve the same thing. The JS library seems really straight forward in comparison though but I haven't tried it since I wouldn't know how to get grid data from JS in there...

      2. taxaw

        I vote for a solution or plugin by Joget Team. Hugo, please...

      CommentAdd your comment...
    3.  
      2
      1
      0

      https://docxtemplater.readthedocs.io/en/latest/generate.html (Browser paragraph)

      Just with docxtemplater javascript library we can generate word document, using customHTML form element.

        CommentAdd your comment...
      1.  
        2
        1
        0

        Hi guys,

        I had another quick look and it seems there are quite a few capable and fairly straight forward libraries available for this now:

        https://github.com/opensagres/xdocreport/wiki/Overview

        http://jsolve.github.io/java/templ4docx/

        And obviously Apache POI.

        The interface could be quite simple - eg selecting a file upload field and defining the variables in the docx template + corresponding Form fields (or just a textfield where hash variables could be used).

        Especially xdocreport seems to have the capability to go straight to PDF as well.

        Cheers,

        Eric

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Following

            CommentAdd your comment...
          1.  
            1
            0
            -1

            Hi,

            It has been 4 years since this was proposed. I cannot seem to find this functionality in the latest DX. Can somebody from Joget team please let us know if this is in the plans?

              CommentAdd your comment...