Features Overview

GroupDocs.Assembly for Node.js via Java generates documents in popular office and email file formats from template documents and data obtained from JSON, XML, CSV, DataSet objects, and tables of other documents. The main features are:

  • Multiple data formats support
  • Formulas and sequential data operations
  • upper, lower, caps, firstCap formatting of strings in template syntax
  • Ordinal, cardinal, alphabetic and other numeric formats in template syntax
  • Variables and text comments within template syntax tags
  • Dynamic insertion of outer document content
  • Dynamic background color and barcode generation
  • Dynamic hyperlinks and bookmarks, email attachments and message body attributes
  • Analogue of the Microsoft Word NEXT field
  • Updating fields while assembling word processing documents
  • Calculating formulas while assembling spreadsheet documents
  • Formatting of numeric, text, image, date-time and chart elements
  • Conditional formatting of template text elements
  • LINQ-based template syntax
  • Changing the format of the assembled file by an explicit specification or by the file extension
  • Removal of empty paragraphs
  • Charts, images, tables, lists and other report types
  • In-line template syntax error messages instead of exceptions
  • Loading templates from HTML with resources and saving assembled documents to HTML with resources

The details are given below.

Data Sources

Data Formats

FeatureSupport in GroupDocs.Assembly for Node.js via Java
JSONSupported (using JsonDataSource)
XMLSupported (using XmlDataSource or DataSet.readXml)
CSVSupported (using CsvDataSource)
Database-like dataSupported (using DataSet, DataTable, DataRelation and related classes)
OData and other web servicesSupported through the JSON or XML payload returned by the service
Custom objectsNot supported (plain JavaScript objects are not Java objects and cannot be used as data sources; use JSON or XML with the same shape instead)
Spreadsheet as a table of dataSupported (using DocumentTable and DocumentTableSet)
Word processing table as a table of dataSupported (using DocumentTable and DocumentTableSet)
Presentation table as a table of dataSupported (using DocumentTable and DocumentTableSet)

A simple value (a string or a number) can also be passed as a data source and referenced by its name in a template. See Using Documents as Data Source for details on DocumentTable.

Data Manipulation Capabilities

FeatureSupport in GroupDocs.Assembly for Node.js via Java
FormulasSupported
Sequential Data Operations (filtering, ordering, grouping, aggregating, etc.)Supported (through LINQ-like syntax for data sources of all types; extension method analogues are named using lower camel case)
Type Member InvocationSupported (members of Java types of data values, for example java.lang.String methods)
Built-In Data Relation SupportSupported (DataSet relations, JSON/XML hierarchy, DocumentTableSet relations)
Data Processing CustomizationLimited (custom types cannot be defined in JavaScript)
External Document ImportSupported

Multiple Data Sources

DocumentAssembler.assembleDocument accepts several DataSourceInfo objects, so a template can reference multiple data sources by their names:

const groupdocs = require('@groupdocs/groupdocs.assembly');

const table = new groupdocs.DocumentTable('Managers Data.docx', 1);

const assembler = new groupdocs.DocumentAssembler();
assembler.assembleDocument('template.docx', 'report.docx',
    new groupdocs.DataSourceInfo('Hello', 'a'),
    new groupdocs.DataSourceInfo('World', 'b'),
    new groupdocs.DataSourceInfo(table, 't'));

process.exit(0);

Template Formats, Elements and Syntax

Template Document Formats

Word Processing Document Formats

Word processing formats, including Microsoft Word and OpenOffice text document formats, are supported. See Supported Document Formats.

Spreadsheet Document Formats

Spreadsheet formats, including Microsoft Excel and OpenOffice spreadsheet formats, are supported. See Supported Document Formats.

Presentation Document Formats

Presentation formats, including Microsoft PowerPoint and OpenOffice presentation formats, are supported. See Supported Document Formats.

More Document Formats

Email, HTML, Markdown, plain text and other formats are also supported. See Supported Document Formats.

Dynamic Merging of Table Cells

Table cells with equal textual contents can be merged dynamically using the cellMerge tag.

Textual Comments within Template Syntax Tags

An optional comment provides a human-readable explanation that the engine ignores:

<<tag_name [expression] –switch1 –switch2 ... // optional_comment >>

In-lining of Syntax Error Messages into Templates

Syntax error messages can be written into the assembled document instead of throwing an exception. See Use of In-line Syntax Error Messages into Templates.

Template Elements

FeatureSupport in GroupDocs.Assembly for Node.js via Java
Formatted Text BlocksSupported
HTML BlocksSupported
Repeated Blocks (including list items and table rows)Supported
Conditional BlocksSupported (including list items and table rows)
Pivot TablesTo be supported
ImagesSupported
ChartsSupported
BarcodesSupported
Bound Form ControlsTo be supported
Hyperlinks to URI or BookmarksSupported

Template Syntax Formats for Expression Results

Specifying String Formats

String FormatDescription
lowerConverts a string to lower case (“the string”)
upperConverts a string to upper case (“THE STRING”)
capsCapitalizes a first letter of every word in a string (“The String”)
firstCapCapitalizes the first letter of the first word in a string (“The string”)

Specifying Numeric Formats

Number FormatDescription
alphabeticFormats an integer number as an upper-case letter (A, B, C, …)
romanFormats an integer number as an upper-case Roman numeral (I, II, III, …)
ordinalAppends an ordinal suffix to an integer number (1st, 2nd, 3rd, …)
ordinalTextConverts an integer number to its ordinal text representation (First, Second, Third, …)
cardinalConverts an integer number to its text representation (One, Two, Three, …)
hexFormats an integer number as hexadecimal (8, 9, A, B, C, D, E, F, 10, 11, …)
arabicDashEncloses an integer number with dashes (- 1 -, - 2 -, - 3 -, …)

Variables in Template Documents

Variables can be defined in template documents as follows:

<<var [st = "Hello, "]>><<[st]>><<var [st = "World!"]>><<[st]>>

Support for Outer Document Insertion

Contents of outer documents can be inserted into reports dynamically.

Barcode Image Generation

Barcode images can be generated in reports dynamically.

Support for Analogue of Microsoft Word NEXT Field

The <<next>> tag moves to the next data item. It is supported only within data bands created by the <<foreach>> tag.

Setting Background Color Dynamically

The background color of text can be set dynamically using the backColor tag:

<<backColor ["red"]>>text with red background<</backColor>>

For HTML documents, the backColor tag is not supported; use the HTML style attribute instead.

Inserting Images Dynamically

Images can be inserted into reports dynamically using image tags:

<<image [image_expression]>>

Ability to Update Fields

Fields can be updated while assembling word processing documents. See Updating Fields While Assembling Word Processing Documents.

Ability to Calculate Formulas

Formulas can be calculated while assembling spreadsheet documents.

Template Elements Formatting

FeatureSupport in GroupDocs.Assembly for Node.js via Java
Numeric/Date-Time Value FormattingSupported
Text FormattingSupported
Conditional Text FormattingSupported (only through conditional blocks)
Image FormattingSupported (WYSIWYG)
Chart FormattingSupported (WYSIWYG)

Template Syntax

FeatureSupport in GroupDocs.Assembly for Node.js via Java
LINQ-BasedSupported, extension method analogues are named using lower camel case
MustacheTo be supported

Expressions in templates use Java syntax and Java types, because the engine runs on the JVM. See Template Syntax - Part 1 of 2.

Changing Output File Format

The target format of an assembled document can be defined by the file extension or by an explicit specification. See Changing Target File Format.

Loading HTML and Saving to HTML with External Resource Files

Template documents can be loaded from HTML with resources, and assembled Word, Excel, PowerPoint and email documents can be saved to HTML with external resource files.

Numbering Restart in Nested Numbered List

List numbering can be restarted dynamically using <<restartNum>> tags. This is useful for a nested numbered list within a data band.

Metered Licensing

The Metered class provides metered licensing. See Evaluation Limitations and Licensing.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.