/// <summary> /// Generates the document using doc with table generator. /// </summary> private static void GenerateDocumentUsingDocWithTableGenerator() { // Test refreshable document with table generation from template("Test_Template - 2.docx") DocumentGenerationInfo generationInfo = GetDocumentGenerationInfo("SampleDocumentWithTableGenerator", "1.0", GetDataContext(), "Test_Template - 2.docx", false); SampleDocumentWithTableGenerator sampleDocumentWithTableGenerator = new SampleDocumentWithTableGenerator(generationInfo); byte[] result = sampleDocumentWithTableGenerator.GenerateDocument(); WriteOutputToFile("Test_Template2_Out.docx", "Test_Template - 2.docx", result); }
/// <summary> /// Refreshes the document using doc with table generator. /// </summary> private static void RefreshDocumentUsingDocWithTableGenerator() { // Test refreshable document with table refresh from template("Test_Template2_Out.docx") DocumentGenerationInfo generationInfo = GetDocumentGenerationInfo("SampleDocumentWithTableGenerator", "1.0", GetDataContextRefresh(GetDataContext()), "Test_Template2_Out.docx", false); SampleDocumentWithTableGenerator sampleDocumentWithTableGenerator = new SampleDocumentWithTableGenerator(generationInfo); byte[] result = sampleDocumentWithTableGenerator.GenerateDocument(); WriteOutputToFile("Test_Template2_AfterRefresh_Out.docx", "Test_Template2_Out.docx", result); }