Proposal Automation Software

Word Document Generation from Oracle Database

Posted by on 30th Novemeber 2017

Oracle Word Document

In every organization, database plays an important role in holding entire organization’s data across functions/departments. IBM, Microsoft & Oracle control close to 89% of DBMS market with Oracle leading the pack with >40% of the total database market. It is widely used in enterprise applications.

For organizations creating state-specific/country-specific documents such as insurers, health care institutions and financial institutions etc., manual creation of documents from database records is a costly and time-consuming task. The document templates undergo a frequent change that forces associated code changes every time.

While SQL Server users have the luxury of zapier integrations for connecting to document automation/document generation systems, Oracle users don’t have that option. Hence the only option for Oracle business users is to rely on the development team for document generation. But getting developer’s time is difficult and is expensive. Hence business users require a DIY document generation system and here comes EDocGen.

EDocGen Solution

The solution has 2 parts.

  • . Exporting Oracle DB data into XML
  • · Populating that XML into document template using EDocGen

Either these steps can be carried out sequentially or automate them by integrating with EDocGen API. Just make sure XML tags of step 1 matches with that of dynamic field tags of Document in step 2.

Step1: Exporting XML from Oracle DB

SQL allows you to retrieve Oracle DB data in XML format. Writing SQL is a one time job and SQL can be changed easily whenever template changes. System admins (DBA) and many business users are adept at SQL. Following examples explain how to export Oracle database data as XML. I took this example from Gert Poel's blog post.


Using XMLAgg we can retrieve one row with all records from the query.


Now our XML is ready. Next step is to populate this XML into document template using EDocGen

Step2: Populating XML into Document Template

EDocGen is Windows OpenXML based solution that supports filling of dynamic text, tables, and images from XML data into document templates. Please visit XML to Word blog for a detailed description on how to go about XML population. Briefly,

1. Upload existing template after adding tags for dynamic fields. Alternatively, you can add tags through EDocGen editor after uploading the template

2. Populate it with XML by uploading XML and click generate

3. Download generated documents

Popular Posts