GroupDocs.Assembly
Generate documents and reports from templates and data using LINQ syntax — with a single, consistent API across .NET, Java, and Python.
Choose your platform selecting one updates the snippets below
Getting started with .NET
using System;
using GroupDocs.Assembly;
using GroupDocs.Assembly.Data;
// Path to the main template
string template = "chart_template.docx";
// Retrieve managers' productivity data from the source
DocumentTable data_table =
new DocumentTable("Managers.json", 1);
// Create an instance of DataSourceInfo with the data
DataSourceInfo data
= new DataSourceInfo(data_table, "managers");
// Set chart colors using another DataSourceInfo
DataSourceInfo design =
new DataSourceInfo("red", "color");
// Fill the template with data and save it to the output
DocumentAssembler asm = new DocumentAssembler();
asm.AssembleDocument(template, "result.docx", data, design);
import com.groupdocs.assembly.*;
// Path to the main template
String template = "chart_template.docx";
// Retrieve managers' productivity data from the source
DocumentTable data_table =
new DocumentTable("Managers.json", 1);
// Create an instance of DataSourceInfo with the data
DataSourceInfo data
= new DataSourceInfo(data_table, "managers");
// Set chart colors using another DataSourceInfo
DataSourceInfo design =
new DataSourceInfo("red", "color");
// Fill the template with data and save it to the output
DocumentAssembler asm = new DocumentAssembler();
asm.assembleDocument(template, "result.docx", data, design);
import groupdocs.assembly as ga
def run():
# Path to the main template
template = "chart_template.docx"
# Retrieve managers' productivity data from the source
data_table = ga.data.DocumentTable("Managers.json", 1)
# Create an instance of DataSourceInfo with the data
data = ga.DataSourceInfo(data_table, "managers")
# Set chart colors using another DataSourceInfo
design = ga.DataSourceInfo("red", "color")
# Fill the template with data and save it to the output
asm = ga.DocumentAssembler()
asm.assemble_document(template, "result.docx",
data, design)
Popular classes & namespaces
Class
DocumentAssembler
GroupDocs.Assembly
Method
DocumentAssembler.AssembleDocument
GroupDocs.Assembly
Class
DataSourceInfo
GroupDocs.Assembly
Class
LoadSaveOptions
GroupDocs.Assembly
Enum
FileFormat
GroupDocs.Assembly
Class
DocumentTable
Assembly.Data
Class
JsonDataSource
Assembly.Data
Class
XmlDataSource
Assembly.Data
Key capabilities
- Template-based document generation
- LINQ reporting syntax
- Data from DB, XML, JSON & objects
- Charts, tables & lists
- Mail merge
- Cross-format output
Supported formats
WordExcelPowerPointEmailPDFHTML
…and 40+ more document and web formats.
Resources
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.