Generating a word document in dhis

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.

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@thoughtworks.com 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!!

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)

···

On Mon, Jun 6, 2016 at 12:54 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Devs

It would be helpful to get your inputs on this aspect.

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, May 31, 2016 at 11:00 AM, Sultanahamar Mohammad sultanm@thoughtworks.com 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!!

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@dhis2.org 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@thoughtworks.com wrote:

Hi Devs

It would be helpful to get your inputs on this aspect.

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Tue, May 31, 2016 at 11:00 AM, Sultanahamar Mohammad sultanm@thoughtworks.com 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!!

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

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 :wink:

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@thoughtworks.com 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


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jun 6, 2016 at 1:10 PM, Morten Olav Hansen morten@dhis2.org 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)


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

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@thoughtworks.com wrote:

Hi Devs

It would be helpful to get your inputs on this aspect.

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Tue, May 31, 2016 at 11:00 AM, Sultanahamar Mohammad sultanm@thoughtworks.com 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!!

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

I think its going to be hard to do this in a generic way which is
going to meet the requirements of different users simultaneously.
docx is just a document format. The bigger part is the report design
and layout which is either going to be off some input template (which
will not meet everyone's needs) or via some more flexble designer
interface which starts to roam into territory where there is already
good tooling.

I suspect the best approach might be to create some separate kind of
server-side micro service using the tools/language of your choice (eg
node based) which talks to the dhis2 via its api rather than add to
core. And of course make your code available so others can tinker ..
might be you end up with next big killer application :slight_smile:

···

On 7 June 2016 at 03:18, Lars Helge Øverland <lars@dhis2.org> wrote:

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 :wink:

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@thoughtworks.com> 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@dhis2.org> >> 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@thoughtworks.com> >>> 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@thoughtworks.com> 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: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
With Regards
ThoughtWorks Technologies
Hyderabad

--Stay Hungry Stay Foolish!!

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

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

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help