GroupDocsGists
10/24/2017 - 1:13 PM

Examples-GroupDocs.Assembly.Examples.Java-src-main-java-com-groupdocs-assembly-examples-GenerateReport-barcodedocument.java

// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-Java
String srcDocument = "/Word Templates/Multiple DS.docx";
String docReport = "/Word Reports/Multiple DS_report.docx";
try {
	 //Create an array of data source objects
                Object[] dataSourceObj = new Object[] { new DataStorage(), DataStorage.excelData() };
                //Create an array of data source string
                String[] dataSourceString = new String[] { null, "contracts" };
	DocumentAssembler assembler = new DocumentAssembler();
	assembler.assembleDocument(CommonUtilities.getTestDataPath(srcDocument),
			CommonUtilities.getTestOutPath(docReport), dataSourceObj, dataSourceString);
} catch (Exception exp) {
	System.out.println("Exception: " + exp.getMessage());
}