← Back to team overview

dhis2-devs team mailing list archive

Re: Generating a word document in dhis

 

Hi Vanya,

thanks for raising this.

In general we have had some requests for exporting various outputs in DHIS
2 to Word over the years, so this could clearly be useful.

To say something meaningful about this would require a bit more info on
what you are trying to do ;)

In any case I think i makes sense to support Word representation of various
DHIS 2 entities, such as dashboards and charts. For instance, supporting
download of a dashboard with all its items as Word I am sure some people
will find useful.

In that case it could be that POI is a better choice compared to docx4j, as
it seems a bit heavy and based on JAXB, whereas POI is already in the
system meaning you will not increase the quickly-growing WAR file.

I am not entirely sure that a generic something-to-Word generator is a good
thing if it is not used by anything in DHIS 2 core. What would the input
format look like - are you inventing a new format?


Another question - I sense that you are building a canned report builder.
Could it be an option to build that as an extension of the existing DHIS 2
Dashboard / DashboardItem data model? It allows you to include any number
of report tables, charts, maps in a defined order. You could build a few
new dashboard item types, such as free texts, custom images etc, and add
additional styling options. That way, you would already have persistence
and data model in place which you can build the Word export around. In
addition it will be a useful add-on to the core software.


Let me know if this makes sense.

regards,

Lars




On Mon, Jun 6, 2016 at 7:09 AM, Vanya Seth <vanyas@xxxxxxxxxxxxxxxx> wrote:

> Hi Morten
>
> Thanks for the response. We are looking at apache *POI* and *docx4j*. We
> are also looking at some node based solutions like *officegen*. There is
> one more interesting software that we have evaluated called *pandoc*.
> This is a very powerful tool and is capable of converting between different
> formats (ODF, openXML document, Microsoft XML, JSON,Markdown..etc).
>
> The general requirements we are looking at are (in case we go through the
> server side approach). The API contract is still not clear to us. Will have
> to spend some time on it.
>
> But roughly it entails:
> - Exposing an API that will take in the content and give out a word
> document.
> - The input DTO we will have to design which will have the details about
> the styling, tables, images, paragraphs (the current requirement)
>
> Does it look like a generic requirement? Would like to hear from about it
> from Lars and others as well.
>
> Regards
> Vanya
>
>
>
> On Mon, Jun 6, 2016 at 1:10 PM, Morten Olav Hansen <morten@xxxxxxxxx>
> wrote:
>
>> Hi
>>
>> From the server side, what libraries are you looking into? POI? we
>> already have POI in the classpath, so at least it wouldn't add any
>> dependencies.
>>
>> If this is useful generic, I will let Lars answer... maybe you can write
>> a bit more about your exact requirements, would you basically be supporting
>> `iReport` like reports, just with `.docx` as output instead of `.pdf` ? (so
>> that would include, charts, text, etc)
>>
>> --
>> Morten Olav Hansen
>> Senior Engineer, DHIS 2
>> University of Oslo
>> http://www.dhis2.org
>>
>> On Mon, Jun 6, 2016 at 12:54 PM, Vanya Seth <vanyas@xxxxxxxxxxxxxxxx>
>> wrote:
>>
>>> Hi Devs
>>>
>>> It would be helpful to get your inputs on this aspect.
>>>
>>> Regards
>>> Vanya
>>>
>>> On Tue, May 31, 2016 at 11:00 AM, Sultanahamar Mohammad <
>>> sultanm@xxxxxxxxxxxxxxxx> wrote:
>>>
>>>> Hi Team,
>>>>
>>>> We have a use case where we have to generate word document off some
>>>> charts, pivot tables and some commentary around them. For this we have
>>>> explored some server side libraries. If we have a generic implementation
>>>> around this, can we place it in dhis code and expose api. We have looked at
>>>> couple of java based and node based libs.
>>>> What are your thoughts around this?
>>>>
>>>> Regards,
>>>> Sultan Ahamar.
>>>>
>>>
>>>
>>>
>>> --
>>> With Regards
>>> ThoughtWorks Technologies
>>> Hyderabad
>>>
>>> --Stay Hungry Stay Foolish!!
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
>
> --
> With Regards
> ThoughtWorks Technologies
> Hyderabad
>
> --Stay Hungry Stay Foolish!!
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>

Follow ups

References