> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/export.md).

# Export, print and copy trend data

Export trend data to a CSV file for Excel, with or without a sample rate, save a plot as a JPEG picture, or print it.

A comma separated value (CSV) file is created by using the export function and selecting the required settings. It takes the currently viewed data of the current plot and can be read by Microsoft Excel or any other '.csv' compatible program. A JPEG export file takes a snapshot of the currently viewed plot, and is very useful for sending via email and displaying on the Internet. When creating a CSV file or a JPEG image, or printing, remember that exactly what you have displayed on the plot will be used, so set up the plot properly first.

{% hint style="info" %}
**Applies to:** DATRAN Trending V5.x. DATRAN Trending Basic can't print or export.
{% endhint %}

## Export to a CSV file

1. Select **File > Export Plot**, or click the export button.
2. Select **CSV File (\*.csv)**.
3. Decide on a **Folder** to store this file. You can change the file name, which is automatically generated in the format `<Name of Plot> <Date> <Time>.csv`. Plots with names that have invalid filename characters will have them stripped out. If no folder is selected the application will automatically save the file to the temporary directory specified in your computer's Environment Variables.
4. Decide on the date time format. Choose from one of the options in the combo box or type in your own custom format.
5. If you decide to arrange the pen data side by side, decide on the granularity/sample rate. When this format is chosen, the granularity/sample rate cannot be zero.
6. Once all the settings are filled in, click **OK**. This will then create the file in the specified folder.

![The Exporting Plot window, with CSV File selected](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2Ffz7wPqbJZPv3mF2LWEjc%2Ftrending-export-dialog.png?alt=media)

### Raw data or a sample rate?

| Layout                                            | What you get                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Raw data (pens one after another)                 | The first line of the file describes the actual plot: the plot ID, plot name, start date/time and stop date/time. It then lists all the active and enabled pens and the data that is actually displayed on the screen at the time of exporting. The first line of each pen states the pen number, point name and the type of the pen (event, alarm or analogue). If the pen is an analogue it also displays the min and max currently set for that pen. It then lists all the logged data that is displayed for that pen. |
| Each pen in a separate column, with a sample rate | All active pens are displayed in separate columns, with a single timestamp for ease of processing in spreadsheet/Excel etc. When this format is chosen, the sample rate cannot be zero. When there is no data within a sample rate, an interpolated value is used instead.                                                                                                                                                                                                                                                |

The two techniques can give different results. With a sample rate, the first date stamp on the CSV export will be the start time set in the plot, for example 9:30pm on 8 July. The next time stamp will be at the selected 15 minute sample, so 9:45pm and so on. If the data is not logged at that time, then interpolation will happen. With raw data, the first date stamp on the CSV file is the first value logged after the start time, in the example 81.7% at 10:25pm. To see why, switch to **Current Plot > Point Graph**, which highlights the actual points logged, then hover over the data point after 9:30pm: no data was logged at 9:30pm, and the first level logged after was 81.7% at 10:25pm.

A pen's **Interval** setting controls which points are included when the plot is exported to a CSV file: see [Set up pens](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/pens.md#change-one-pen).

## Save the plot as a picture

1. Select **File > Export Plot...** from the File menu.
2. To create a JPEG image file, first ensure **JPEG File (\*.jpg)** is selected.
3. Decide whether you want the point names to show on the graph. Select this if you have hidden the legend.
4. Then decide on a folder to place this file. You can choose the file name although at first it is automatically generated in the format `<Name of Plot> <Date> <Time>.jpg`. If no folder is selected the application will automatically save the file to the temporary directory specified in your computer's Environment Variables.
5. Once all the settings are filled in, click **OK**.

## Print a plot

1. Press Ctrl + P, or from the **File** menu select **Print Plot...**, or from the navigation control bar click the print the current plot button.
2. To use the printer, first ensure the printer is selected. You can select a printer other than your default printer as long as it has been configured in your operating system. To increase or decrease the number of copies to be printed click on the spin or up/down buttons.
3. Decide whether you want the point names to show on the graph. It is recommended that you select this if you have hidden the legend. Click the **Setup...** button to change the printer setup such as paper size, paper source, orientation, etc.
4. Finally click **OK** and the currently viewed plot is printed to the selected printer exactly as viewed.

## Large exports

If the file opens Microsoft Excel but does not display any information, or an error occurs when opening this file, the problem could be that there is too much information in the file to display in an entire Microsoft Excel document. Try reducing the span of the graph to only display the actual necessary information and run the CSV export again. Alternatively, choose the format that will arrange the pens side by side instead of one after another, and remember to select a sample rate of more than zero. See [An exported CSV file won't open properly](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/troubleshooting/csv-will-not-open.md).
