Generate sample report for document with variable

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

Template Syntax

assembler = ga.DocumentAssembler()
dataSource = ga.data.XmlDataSource("datasource.xml")
DataSourceInfo = ga.DataSourceInfo(dataSource)
array = [DataSourceInfo]
print(assembler.assemble_document(input.ppt, output.ppt, array))

DataSource XML

<Product>
    <Discount>0</Discount>
    <ProductID>1</ProductID>
    <ProductName>LG Nexus 5</ProductName>
    <ProductPrice>350</ProductPrice>
    <UnitsInStock>5</UnitsInStock>
	<Barcode>123456789qwertyu0025</Barcode>
  </Product>

The Recipe

  • Set up the source document data path
  • Set up the source document template path
  • Set up destination report path
  • Instantiate DocumentAssembler class
  • Generate report

More resources

Advanced usage topics

To learn more about library features, please refer to theadvanced usage section.

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples: