Description of the problem
This guide explains how to create a custom Excel template for data exports. The primary benefit of using a template is that you can pre-configure elements like charts, which will automatically update when new data is exported.
Description of the solution
We'll start by modifying an existing template that plots a single column of data, and we'll update it to plot two data columns.
1. Duplicate an Existing Template
First, copy the existing template by clicking on it and using the + button. You will need to properly name it, like for example:
Setup name: 2 graphs
Description: [for channel 1,2]
2. Edit the Template Chart
Now press Edit while the new template is selected to open it in Excel. We'll now edit the template so that the graph on "Results" sheet will also display the third column from "Data1" sheet.
The template is designed so that when you export, your measurement data is placed on the Data1 sheet. The chart on the "Results" sheet is linked to the cells on the "Data1" sheet.
The graph in "Results" sheet will still reference to the same cells, but there will be new data there.
Let's now add also the third column to the graph. Edit the graph as presented in the gif below.
3. Save the Template Correctly
After that, we need to properly save this template. In Excel, go to File > Save As. Name it exactly the same as the initial template ("2 graphs" in our case) and save it in to the scripts folder
(normally: C:\Users\Public\Documents\Dewesoft\System\Scripts).
Ensure the file type is set to Excel Template (.xltx).
When saving, be sure that it gives you the prompt pictured below, asking you if you want to overwrite an existing file. You will need to overwrite the existing file as the helper .xps file is referencing the .xlsx template made when we pressed the + button.![]()
4. Use Your New Template
The new template is now ready, let's use it. I've set up 2 simple AI channels and selected our new template.
In your measurement setup, select your new template, "2 graphs", from the export options.
Now we are exporting to a new .xlsx file to export folder named test.xlsx. Pictured below is "Data1" sheet of this file where the exported data is located.
