Jump to content
We've recently updated our Privacy Statement, available here ×

Converting Word documents to Jasper Reports


wasseydev

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...