Last active
April 28, 2021 10:37
Generate Reports from Excel Data in C# using GroupDocs.Assembly for .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generate Reports from Excel Data using C# | |
1. Get Excel Data Source | |
2. Define Template | |
3. Generate Report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string ExcelDataFile = "Contracts_Data.xlsx"; | |
string strDocumentTemplate = "Template.docx"; | |
string strDocumentReport = "Output.docx"; | |
// Define data table from Excel file | |
DocumentTableOptions options = new DocumentTableOptions | |
{ | |
FirstRowContainsColumnNames = true | |
}; | |
DocumentTable table = new DocumentTable(ExcelDataFile, 0, options); | |
// Assemble a document using the external document table as a data source. | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(strDocumentTemplate, strDocumentReport, | |
new DataSourceInfo(table, "contracts")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment