How to do "document merge"

Aware IM can perform “document merge” of Microsoft Word documents, Microsoft Excel documents, plain text documents and HTML documents. If you want to provide the “document merge” functionality in your system you have to configure document templates of any of the above mentioned types (see the “Adding/Editing Document Templates” section). Alternatively you can use document templates defined by the end user (Developer Edition only)

The templates must include tags that will be “merged” with real data when the final document is produced – see the “Document Generation” section for details on how it is done. To get Aware IM to produce the “merged document” so that the user can see it and print it out you can do either of the following:

  • Define a menu item of the Create Document type (see the “Setting Menu Item Properties” section. Aware IM includes the default menu item of the Create Document type that allows the user to select the document she wants to create among all the document templates defined. Alternatively you can configure your own menu item that will generate the document from your specific document template. When a user selects this menu item in the Operation Mode Aware IM will generate the “merged document” and show it on the screen (then it can be printed from the browser). A document created in this manner is not stored in the system and have to be re-created each time.
  • Define an attribute of the Document type in some business object and set its initial value to the name of your document template (see the “Attributes of Document Type” section). Whenever the instance of the business object is created the “merged document” will be generated and stored permanently as the value of the attribute. The user can bring up the form of the business object and press the View Document button to get the document to be displayed on the screen (then it can be printed from the browser). A document created in this manner gets permanently stored in the system together with the instance of the business object.
  • A document may be generated as part of the process that uses DISPLAY DOCUMENT action. When the action is executed the document is displayed on the screen. Note that the action can generate the document from the template as in the first option or display the document already stored as the value of the attribute of the Document type as in the second option.
  • Define a form operation of the Create Document type that can be invoked from the form of the business object. The instance of the object being edited will be used as the data source for the “merged document”. See the “Adding/Editing Form Operations” section for more details.

The data that Aware IM will use for the document may come from several sources:

  • The user may explicitly specify a query to be used as part of the Create Document menu command
  • The user may explicitly select certain instances of objects to be used as the data source when viewing the results of some query and then run the Create Document operation
  • You can specify the query in your process as the FIND action that will put the desired data into the context.
  • You can specify the query in the DISPLAY DOCUMENT action (USING clause)
  • You can specify the query when configuring the document template

The preferred approach is to use the DISPLAY DOCUMENT action in a process. The action may use the query as the data source. If you are displaying the report Aware IM will just display it on screen. For other types of documents Aware IM will generate as many documents as there are instances returned by the query. You can get Aware IM to display the results on screen and let the user select specific instances to print out. Or you can use the MERGE INTO ONE clause in the action in which case Aware IM will merge all documents into a single document and show it immediately to the user who can then print it out.

  • Last modified: 2022/09/13 18:15