This page contains:
One of the most common features you'll add to your template is a custom property.
Custom properties allow you to repeat certain information in multiple locations in the report. They are useful for displaying:
Before being able to put our custom properties in different locations of our document, we have to add them:
Click on Custom, and add a few properties.
The property Value can be anything as long as it won't be flagged by Word's internal spellchecker.
Now that your template has several custom properties in it, we can place insert them in different locations.
Lets use a common location for this type of content: a table where we list a few details about the document itself:
Lets start with
dradis.client. Navigate with the cursor to the cell where you want to insert it.
And the new document property will be inserted in the current position. If you click over it, you'll see a darker background indicating this isn't normal text, but a document property:
Finally, we repeat the process for the other properties
If the field is flagged as a spelling error with a red wavy line underneath, you're going to run into problems on export. If this happens, just change the Value of the field. For example, change "ClientCompanyName" to "Client Company Name" to avoid this problem.
All the work on the template side of things is over. Lets move on to Dradis.
Custom document properties are stored in the Report content page of your Dradis project. For more on how to add your document properties to your Project, check out the Report Content page of the Project guide.
Word really enjoys not automatically updating these document properties on export. You'll often see placeholder text displayed until you force it to show the real value with an update field. You have three options to update your properties and fields (including SEQ fields) post-export:
This option doesn't scale well to large reports. But, you can manually update fields by right-clicking on them and selecting Update Field as shown below.
Open up your exported Word report, then use the following keyboard shortcuts to update all the fields.
Note: if your document has fields within tables, headers, or footers, this method may not update them.
CTRL + A
Alternatively, you can use the following macro to update all the properties and fields in your document at once:
Sub UpdateAllFields() ' ' Macro to completely update the document ' ' Kudos to Sherief for this one ' ActiveDocument.Fields.Update For Each sec In ActiveDocument.Sections For Each head In sec.Headers head.Range.Fields.Update Next head For Each foot In sec.Footers foot.Range.Fields.Update Next foot Next sec Dim toc As TableOfContents For Each toc In ActiveDocument.TablesOfContents toc.Update Next End Sub
Next help article: Introduction to content controls →