Working with Simple Data Sources

Support for simple and standalone data sources

GroupDocs.Assembly for Node.js via Java can read JSON, XML and CSV data directly, without building a DataSet first. Each format has its own data source class:

ClassDataLoad options class
JsonDataSourceJSON file or streamJsonDataLoadOptions
XmlDataSourceXML file or stream (with an optional XML schema)XmlDataLoadOptions
CsvDataSourceCSV file or streamCsvDataLoadOptions

All three classes recognize typed values (numbers, Boolean values, dates) from their string representations, so you can use arithmetic, aggregate extension methods and custom number and date-time formats in templates.

A data source object is wrapped in a DataSourceInfo and passed to DocumentAssembler.assembleDocument:

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

const dataSource = new groupdocs.JsonDataSource("managers.json");
const assembler = new groupdocs.DocumentAssembler();
assembler.assembleDocument("template.docx", "report.docx",
    new groupdocs.DataSourceInfo(dataSource, "managers"));
Articles in this section
Close
Loading

Analyzing your prompt, please hold on...

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