GroupDocs.Assembly for Java is designed to Generate Documents based on Templates. It can generate documents in Microsoft Word, Excel, PowerPoint, Outlook, OpenOffice & 50+ other formats by merging data from various sources including databases, XML, JSON, OData and more.
| Directory | Description |
|---|---|
| Examples | Contains the package of all Java examples and sample files that will help you learn how to use product features. |
- Support for multiple data formats including OData, XML, spreadsheets & Word tables.
- Use formulae & perform sequential data operations.
- Apply upper, lower, capital, firstcap formatting to strings in template syntax.
- Template syntax support formatting of ordinal, cardinal, alphabetic numeric nature.
- Support for template documents with custom variables & text comments within template syntax tags.
- Dynamically insert document content & configure background color of html documents.
- Dynamically insert hyperlinks in reports & apply attributes to email message body as well as generate barcodes.
- Dynamically attach email attachments.
- Support of next field analogue of Microsoft Word.
- Update fields during word processing document assembly.
- Apply formula during spreadsheet assembly.
- Template formatting for numeric, text, image, date-time, chart elements.
- Conditional formatting of template text elements.
- Support for LINQ-based template syntax.
- Auto-removal of empty paragraphs.
- Generate various report types, e.g., charts, image, tables, lists and more.
- Inline template syntax errors in generated documents instead of exception throwing.
- Load template documents from html with resources and save assembled Word, Excel, PowerPoint & emails to html with resources.
GroupDocs.Assembly for Java requires J2SE 7.0 (1.7), J2SE 8.0 (1.8) or above. Please install Java first if you do not have it already.
GroupDocs hosts all Java APIs on GroupDocs Artifact Repository, so simply configure your Maven project to fetch the dependencies automatically.
Starting with 26.9.1, GroupDocs.Assembly for Java runs on JDK 17, 21 and later as is - no JVM flags and no code changes are needed.
Earlier versions, 26.9 included, fail on JDK 17 and later for every template that takes its data from a plain Java object:
Can not resolve method 'getCustomer' on type 'class Order'.
The engine generates a data binder per type at run time. Before 26.9.1 it defined that class by calling ClassLoader.defineClass reflectively, and since JDK 16 that call is refused because java.base/java.lang is closed, so the binder was never built and the engine reported the method as missing. 26.9.1 defines the binder through MethodHandles.Lookup, which needs no access to JDK internals. JDK 8 and 11 were never affected.
If you have to stay on an earlier version, use one of these workarounds:
-
Turn the binder generation off - one line before the first report, no launcher changes:
DocumentAssembler.setUseReflectionOptimization(false);
The engine then binds through the reflection API directly. Dynamic class generation pays off on large collections of data items and costs more than plain reflection on small ones, so measure it if your reports are big. On those versions this also avoids
IncompatibleClassChangeError: Found interface ..., but class was expectedfor collections whose element type is an interface. -
Open the package to the JVM, which keeps the generated binders:
java --add-opens java.base/java.lang=ALL-UNNAMED -cp <classpath> com.groupdocs.assembly.examples.MainClassIt has to be repeated in every launcher, container image and IDE run configuration.
| JDK | 26.9.1 | earlier, as is | earlier, setUseReflectionOptimization(false) |
earlier, --add-opens |
|---|---|---|---|---|
| 8, 11 | works | works | works | works |
| 17, 19, 21 | works | fails | works | works |
Home | Product Page | Documentation | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License