Java document automation and reporting APIs

Generate documents from defined templates and data sources. Automate Microsoft Word, Excel, PowerPoint and OpenOffice documents creation.

  Download Free Trial
Java document generation API

GroupDocs.Assembly for Java


GroupDocs.Assembly for Java is a document generation and reports automation API to create custom documents from templates on the fly. APIs take data from defined data sources such as database, Odata, JSON, XML or custom java objects and generate files or reports using defined document template.

Document generation API supports various Template Elements such as Repeated, Conditional, Text and HTML Blocks, Charts and Images. These elements are added to Document Templates to create rich documents as per requirements. Every template element has its own formatting properties like Text, Chart, numeric value formatting and more.

Previous Next

Advanced Document Generation API Features



Multiple document formats support


Generate documents from more than one data sources


Data manipulation features


Support for multiple template elements


Multiple template elements formatting support


Template syntax formatting


LINQ-based template syntax

More than one data sources

Generate documents from following data sources

  • Database
  • Odata
  • JSON
  • XML
  • Custom Java objects

Data manipulation capabilities

  • Formulas implementation
  • Sequential data operations such as filtering, ordering, grouping, aggregating, etc. supported via LINQ syntax for data sources of all types
  • Type member invocation
  • Built-In data relation support
  • Data processing customization supported using external Java types
  • External document import

Support for multiple template elements

  • Formatted text blocks
  • HTML blocks
  • Repeated blocks including list items and table rows
  • Conditional blocks including list items and table rows
  • Images
  • Charts
  • Barcodes supported through barcode fonts
  • Hyperlinks
  • Pivot tables will be supported soon
  • Bound form controls will be supported soon

Template Syntax Formatting

  • String Formatting
    • lower, upper, caps, firstCap
  • Numeric Formatting
    • alphabetic, roman, ordinal, ordinalText, cardinal, hex, arabicDash
  • Outer Document Insertion
    • Outer documents can be inserted in reports dynamically
  • Barcode Image Generation
    • Barcode images can be generated in Word, Excel and PowerPoint documents
  • Multiple template elements formatting support
    • Numeric/Date-Time value formatting
    • Text Formatting
    • Conditional text formatting supported only through conditional blocks
    • Image formatting (WYSIWYG)
    • Chart formatting (WYSIWYG)

Template Syntax

  • LINQ-based
  • Mustache will be supported soon

API Integration

Just few lines of code to integrate API. Here is a sample for generating reports

Generate report in open document format - Java

// Instantiate DocumentAssembler class
DocumentAssembler assembler = new DocumentAssembler();
//Call AssembleDocument to generate report
DocMetadata properties = docFormat.getDocumentProperties();
assembler.assembleDocument("D:\\WordTemplates\\Barcode.docx", "D:\\WordReports\\Barcode_report.docx",  new DataStorage().getManagers().iterator().next();, "value");

Installation and Usage

GroupDocs.Assembly for Java library files can be installed/downloaded directly as:

Fat version
    • Download the library from the download archive.
    • Extract the archive.
    • Open console and cd to lib directory of the extracted directory.
    • Run command mvn install:install-file -Dpackaging=jar -Dversion=17.9.0 -DgroupId=com.groupdocs -DartifactId=groupdocs-assembly -Dfile=GroupDocs.Assembly.jar or just run the install_library.bat to install library in maven

Note: version number and file name can be different from current documentation.

  • Add dependency to your pom.xml
Slim version

This library is hosted in the Maven Central Repository, so if you use Maven in your projects just use the dependency declaration provided above.

The jar itself you can download from the Maven Central Repository.

Another way to use.

All it takes to start rolling with GroupDocs.Assembly is to reference a single GroupDocs.Assembly.jar file.

If you download the Zip Archive as discussed in the previous topic then you are required to add the external library by practicing the following steps in Eclipse:

  • Right click on Java project, and go to Properties.
  • Go to Java Build Path.
  • Open Libraries tab.
  • Press Add External JARs.., and load GroupDocs.Assembly Jar.

Support and Learning Resources


GroupDocs.Assembly offers document automation APIs for other popular development environments as listed below: