This instruction describes how to prepare a Microsoft Word template that could be used to produce an auto-generated report in an application.


There are a few steps you need to do before you can start creating your template. First you need the DataID of the form from which you want to extract the information. Secondly you need the names of the fields. If you don't know how to find ID and the names, please read the Picking up form data: DataID & FieldName article.


Prepare Word template

This instruction describes how to prepare the Word template in Office 2010. To see the initial steps in Office 2007 or 2003, click the links below.


1. Open the Word document you want to prepare.


2. Click the File tab and choose Properties > Advanced properties.



3. Click the Custom tab.




4. In the Name field you specify the form and the field you wish to add. For example ProductRequest.article, where ProductRequest is the DataID of the form and article is the name of the field. (See the article Picking up form data: DataID & FieldName for help finding the ID and the names.)


5. In the Value field you write the text that you want the template to show (this text will be replaced when the report is generated), for example Filled automatically.


47-3_Word.jpg


6. Press the Add button.


7. Repeat steps 4-6 for all the fields that you want to have in your Word document. When you are done, click OK.


8. I have prepared my template with a table where I want to add my fields. To add a fields to the template, place the cursor where the field should be and click the Insert tab.



9. Locate the Quick parts button and choose Fields.



10. In the Field names section, choose DocProperty.


11. In the Property section, locate the field you just added (ProductRequest.article) and press OK.



12. The field is placed where you had the cursor. Continue until your template has all the fields you need.



13. Save your template somewhere on your computer.


Attach the template to your process model

1. Open the process from which the report is going to be generated.


2. Add a Service task and drag and drop the business component SetDocumentProperties on that task.



3. Locate your Word template on your computer and drag and drop the template into you process model.



4. Associate the template with the Service task by right-clicking the line between the template and the task and choosing Direction > To.


5. Save and upgrade your process and application.


Now an auto-generated report will be available in every task after the Service task, in every instance of the process. GOOD LUCK!