wordDocGenerator Step

Use this step to generated documens as DOCX and PDF using MSWord templates.

Last published at: July 27th, 2024

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
  • 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 
 

 

Note:

This widget can identify the line breaks and manual space (such as indentation) in a Text Area widget and generate a document.

 

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 variable/global to store the result after execution
  • Click on the “wordDocGenerator” step to configure its “Settings” properties. Provide a step name. Click on 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 variables/globals to store the DOCX, PDF physical path, and virtual path information. Click the Save button to confirm. 

 

  • Click on the icon to choose the report template for upload. The uploaded file will replace any previous template. Click on the template file name to download the file. Click on Remove Template to permanently remove the existing template from the document path on the server. 

 

  • Click on the “wordDocGenerator” step to configure its “Advanced” properties. Click the button to configure the data source. Provide a file name for the generated document. 

 

  • Navigate to the Advanced tab to configure the data source. Input the connection string, SQL Query, and data source name as shown below. The SQL query result can be accessed through the data source using the Aspose syntax. 

 

  • 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 (...)