Converting Word documents to Jasper Reports

Not a question as such, but just sharing a project that I am working on that may be of help to others. I am developing a Word VBA macro that converts the text content of a Word document (or any other document file that Word can open) and converts it into JasperReports JRXML files.

So far I have developed the following features

  • Text formatting including bold, italic, underline, font, font size, font colour
  • Paragraph formatting including before and after paragraph spacing, left and right indenting, first line indenting (except hanging indents), paragraph alignment (left, right, center, justified)
  • Most bullets and numbering

Please refer to the Dropbox link for a test version: https://www.dropbox.com/sh/4v1ts7ucyfcdp8v/AAB9eHFoyb56IQgFDW_ysqTXa?dl=0

Instructions are in the document text, but are essentially to enable macros, then press Alt+F8 to bring up the macros document, then select one of the macros to process either a selected document, or the macro document itself. A jrxml file is created in the same folder as the selected document, with the same name but with a double-extension (e.g. Doc1.doc will have Doc1.doc.jrxml created).

I'm interested in hearing from the community whether or not this is a tool that would be useful. I'd suggest trying it out on smaller documents to start with (1-2 pages), as it may take a while to process depending on how much text there is.

One of the key priorities is to develop the ability to refer to database fields, allowing dynamic content. This will be my next release.

Thanks for your time, and looking forward to any feedback.

wasseydev's picture
320
Joined: Mar 5 2021 - 12:22am
Last seen: 2 years 1 month ago

This is an intriguing project, especially if you have a large library of existing word documents that needs augmented/updated with dynamic content. Adding the db support will be critical in making this truly useful. Once you get it built out, please by all means create a wiki here in the community and spread the word.

darth_fader - 2 years 2 months ago

Thanks for your feedback. I've just made a post with details of my database query implementation. Not only do I hope that this will be useful for those with existing word documents, but for constructing JasperReports files for new documents. It is far easier to 'just type into a document' than it is to construct something similar using JasperStudio, so its usefulness can extend beyond a collection of old documents.

wasseydev - 2 years 2 months ago

3 Answers:

Hi all, I've updated my dropbox with a second test version. This now has support for specifying a database query, and pulling through the data into the output. Full details are available in my blog post here:

https://wasseydev.wordpress.com/2021/03/13/second-test-version-of-word2jasper-query-field-support/

Hoping that this proves to be a useful tool for the community. I'm also open to feedback on what features are important for this tool.

wasseydev's picture
320
Joined: Mar 5 2021 - 12:22am
Last seen: 2 years 1 month ago
Hello!
Where can I download and test this tool? 
There are only pictures in the Dropbox and not the tool.
j.beckschwarte's picture
Joined: Apr 12 2021 - 11:04pm
Last seen: 2 years 1 month ago

Click on the Dropbox link then you will see icons for each of the versions that is available. Click on the latest available, and then you will see a download button up the top of the screen.

wasseydev's picture
320
Joined: Mar 5 2021 - 12:22am
Last seen: 2 years 1 month ago
Feedback
randomness