4.8.4 Batch Processing with Word Template for Reporting
Origin can perform batch analysis of multiple files and output cell-linked analysis results to an external Word template for reporting.
Minimum Origin Version Required: Origin 2016 SR0
What you will learn
This tutorial will show you how to:
- Add bookmarks from a Word template to a specific Analysis Template
- Link analysis results to bookmarked cells in Word template and adjust the sizes of graphs to be exported
- Sending one time results to Word template for reporting
- Perform batch analysis of multiple files and export results to Word/PDF files
In this tutorial we will use a built-in Word template Sensor Analysis Report.dotx which is located at <Origin EXE folder>\Samples\Batch Processing\ folder. To view the bookmark labels on the Word template, with the file open go to File: Options to open Word Options dialog. Then select Advanced on the left panel and scroll down to section Show document content on the right panel and check Show bookmarks checkbox there.
Add Bookmarks to Analysis Template
- Go to menu File: Open and browse to <Origin EXE folder>\Samples\Batch Processing\ folder, select file Sensor Analysis.ogw to open it.
- Activate worksheet Data, click button and browse to <Origin EXE folder>\Samples\Curve Fitting\ folder and select file Sensor01.dat to import data for analysis.
- Go to menu File: Add Word Bookmarks to Analysis Template... to open dialog. Click the browser button to the right of the Word template box and browse to <Origin EXE folder>\Samples\Batch Processing\ folder to select Sensor Analysis Report.dotx.
- Click to select all bookmark entries in Bookmarks list under Select Bookmarks node and click OK button to add those bookmark entries to active analysis template.
Link Analysis Results to Word Template
- Right click cell next to FileName bookmark in Links column (Long Name) and select Insert Variable.
- In appeared dialog, click Info tab and select FILEName under SYSTEM.IMPORT treenode. Click Insert button to insert it.
- Do the same to insert info variable for bookmark FileDate. To make it display as normal date, right click that cell and select Format Cells.
- Select Date from Format drop-down list and click OK button to close dialog.
- For graph bookmark FittedGraph, right click the cell in Links column (Long Name) in newly generated worksheet Bookmarks to select Insert Graph to open dialog. In appeared dialog, click the browser button to the right of the Graphs box to open Graph Browser dialog. Check Show Embedded Graph checkbox on the bottom left to make embedded graphs available in panel on the left. Click to select desired graph and add it to panel on the right. Click OK to insert graph to Bookmarks worksheet.
Then input graph width for instance 250, in unit of points in GraphWidth (Long Name) column to adjust the size of graph exported to Word report.
- Do the same to insert graph for bookmark ResidualPlot.
- For bookmarks related to parameter values, you can copy and paste values as link from report sheet. To do it, click report sheet Linear Fit of Data B "Sensor Output" and locate the Parameters table. Click the corresponding data cell and right click to select Copy. Return to Bookmarks sheet, right click desired cell in Links column and select Paste Link to build the connection between bookmarks in Word template and values in report sheet.
- Repeat this "Copy and Paste Link" operation to fill in the rest of bookmark links. When done, select menu File: Save Workbook as Analysis Template... to save the analysis template as Sensor Analysis Template.ogw .
Sending One Time Results to Word Template to Create Word Report
Sometimes we may just want to analyze one data file and quickly create one Word report. Continue from the example above, suppose we have all results linked to Word bookmarks as shown in Bookmarks worksheet, to create an one time Word report for active sheet you can simply click Export to Word button on the top left corner to create it.
You can further specify where to output the Word report in appeared Export Path dialog.
Batch Process and Export Results to Word/PDF Files
- Start with a new project.
- Click on the Batch Processing button .
- Make sure Load Analysis Template is selected as Batch Processing Mode. In the Analysis Template drop-down, select the Sensor Analysis Template.ogw file we created earlier (you may need to click the button to the right of the list and browse to the created file).
- Select PDF from Export to drop-down list to export report as PDF file.
- Click the browser button to the right of the Word template box and browse to <Origin EXE folder>\Samples\Batch Processing\ folder to select Sensor Analysis Report.dotx.
- Optionally you can click browser button on the right of Export Path to specify another path for export.
- Click on the Browse button in the File List section and select the Sensor01.dat, Sensor02.dat and Sensor03.dat from the <Origin EXE Folder>\Samples\Curve Fitting folder.
- Click Add File(s), then click OK.
- Select File Name as Dataset Identifier.
- Make sure the Data Sheet drop-down is set as Data.
- Make sure the Result Sheet drop-down is set as Result.
- Make sure that Delete Intermediate Workbook is cleared.
The location of exported PDF files was outputted to Message Log.
A sample of exported PDF version report is as following: