wordDocGenerator Step
Description:
This step generates documents in Word or PDF format using Word templates. These word templates may contain reporting commands specified by the Aspose reporting engine: https://docs.aspose.com/display/wordsnet/Template+Syntax
https://docs.aspose.com/display/wordsnet/Appendix+A.+Enumeration+Extension+Methods
Inputs
- chooseReportTemplate – Choose the desired Report Template
- configureDataSources – Configure the Data Source
- docPhysicalPath – specifies the .docx Physical File Path for the output
- pdfPhysicalPath - specifies the .pdf Physical File Path for the output
- tableRelations - configure the parent and child dataset relations
- docVirtualPath- - specifies the .docx Virtual File Path for the output
- pdfVirtualPath- - specifies the .pdf Virtual File Path for the output
- fileName - PDF / DOC file name for the output
Returns
- True – step executed successfully
- False – step failed to execute
Usage:

Example:
Let’s build and execute the “wordDocGeneratorDef” example.
- Create a new definition called “wordDocGeneratorDef.”
- Select the definition and click the “design” button
- Drag a “wordDocGenerator” step to the canvas
- Connect the dots between the start and “wordDocGenerator” step
- Define a few variables/globals to store the file paths after execution
- Click the “wordDocGenerator” step to configure its “Required” properties. Provide a step name. Click the file selector icon and select the MS Word document template file from the local folder. The file is uploaded to the application server path. Provide the variables/globals references to store the DOCX, PDF physical path, and virtual file path information. Click the Save button to confirm.

- Click the “wordDocGenerator” step to configure its “Optional” properties. The UI is rendered below. Here, you configure the data source and table relations and provide a custom file name for the document.

- Click the icon to upload the Word document template from the local folder. The uploaded file will replace the previous template. You may verify the file for correctness by clicking the template file hyperlink to download it. Click on the Remove Template to permanently remove the existing template from the document path on the server. Click the Close button to continue the configuration.

- Click on the “wordDocGenerator” step to configure its “Optional” properties. Click the button to configure the data source. Click the Add button to insert an empty row. Select the DB connection from the drop-down list. Provide the SQL Select query. Provide the data source name. Click the Add button to insert multiple data sources. Click the Save button. Note: The data source names are unique.

- Click on the “wordDocGenerator” step to configure its “Optional” properties. Click the button to configure the table relations. Click the Add Row button to insert an empty row. Provide the parent and child data source names and column names. Click the Save button. You may insert multiple table relations using the Add button.

- The report template format is shown below.

- Confirm the changes. Save the process definition, create a process instance, and execute. The step should generate the Word document / PDF file and update the physical and virtual file path of variables or globals.
- The generated PDF file is saved with the file name configured above. The content for the example is shown below.

Powerful Document Generation (...)
Definition Sample:
You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.
Click here to download the sample files.