1. Creating and Using Word TemplatesYou can create custom report templates in Word to ensure a consistent appearance across multiple reports. Use templates to define page size, text formatting, and other aspects of report appearance. Complete the following steps to create a template in Word.
- Launch Microsoft Word.
- Select File»New and open the Templates dialog box.
- Select the Template option from the Create New section, as shown in the following dialog box.
- Click the OK button.
The template looks exactly like a Word document, but it has .dot extension instead of a .doc extension. You now can add standard elements to the report template, including a company header and the report date. You also need to identify where in the document you want LabVIEW to insert the graph, which is described in the next section.
2. Using Bookmarks
A bookmark in a Word document or template marks a specific location in that document. In this example, you use a bookmark to identify the location of the graph you will insert from LabVIEW. Complete the following steps to define a bookmark in your Word template.
- Place the cursor in your Word template where you want the new bookmark to be. This location is where LabVIEW will insert the graph.
- Select Insert»Bookmark to open the Bookmark dialog box.
- Enter a bookmark name (for this example, Graph) and click the Add button.
Note Bookmark names cannot contain spaces or any special characters.
- In LabVIEW, use the Word Insert Graph VI to insert a new graph in the current template. Use the bookmark name input to specify where LabVIEW should insert the graph in the Word template. This VI supports all the graph types provided by Microsoft Graph.
- Use the following VIs to modify the scale and to change color and font attributes: Word Set Graph Scale VI, Word Set Graph Colors VI, and Word Set Graph Font VI. Use the Word Format Picture VI to set the graph size or color.
3. Comparison of Graph Properties Available in LabVIEW and Only in Word
You can customize several areas of a graph, including the chart type, axis, font, plot and chart area, chart options, and data series. You can customize some properties programmatically from LabVIEW, but you can customize some properties only in Word. The following table compares graph properties available from LabVIEW VIs and graph properties available only in Word. Refer to the Accessing Graph Properties Only in Word section for information about accessing the properties available only in Word.
|Graph Properties Available from LabVIEW||Graph Properties Available Only in Word|
|Word Set Graph Scale VI
|Word Set Graph Font VI
||Format Plot and Chart Area
|Plot and Chart Area|
|Word Insert Graph VI
Word Set Graph Scale VI
Format Data Series
Format Plot or Chart Area
4. Accessing Graph Properties Only in Word
The following sections explain how to customize properties in Word.
To change the chart type, select the graph by double-clicking anywhere on the graph and then right-click the graph and select Chart Type. This examples uses the XY (Scatter) Plot with data points connected by smoothed lines.
To format an axis, right-click the x- or y-axis and select Format Axis to open the Format Axis dialog box, as shown below.
To format a plot, right-click the plot area and select Format Plot Area, as shown in the figure below.
Chart Area Properties
To format the chart area, right-click anywhere on the graph outside the plot area and select Format Chart Area, as shown in the figure below.
Data Series Properties
Right-click a plot and select Format Data Series to open the Format Data Series dialog box, shown in the figure below. Right-click a data point and select Format Data Series to access additional formatting options for that data point, including the x and y error bars.
Right-click a legend and select Format Legend to set legend properties.
LabVIEW Report Generation Toolkit for Microsoft Office User Guide