One of the possible ways for users to interact with an information system or databases is to generate and print reports and forms. In which data is formatted and placed on the page the way to facilitate human perception. One of the most popular text processors is Microsoft Word having many good features to prepare and publish documents. And it would be great to use Word styling and formatting features to visualize data extracted from the Oracle database. Fortunately, it is possible thanks to three things:
- Office Open XML format of documents saved from Microsoft Office. Each such document is a ZIP archive containing XML files that can be extracted, processed, or replaced in the archive.
- Word Content Controls, which are containers for specific content in a document. They help to create rich, structured blocks of content, fix the position of that blocks, and are designed for use in templates that insert well-defined blocks into documents.
- Custom XML allows embedding XML data in a Word document and maps (bind) custom XML nodes and attributes to Content Controls. When Word opens a document with CustomXML mapped to Content Controls, it displays values of XML attributes in places of Content Controls.
So all needed is 4th component - reporting engine – a piece of software that combines and employs these three standards and
- Allows a developer to create Report Definition i.e. is a set of rules on how a report is created.
- Accepts report parameters from an end-user.
- Automates generation of CustomXML file that based on Report Definition, parameters entered by an end-user, and data stored in a database.
- Replaces original (empty) CustomXML file in OOXML archive (.docx file) with generated one.
- Returns prepared .docx file to the end-user.
The scheme below depicts a typical workflow of report design and generation:
Report Designer is a tool that realizes the described approach.