# Generate Spreadsheet Data

> Source: https://manual.pvxplus.com/how-to/generate-spreadsheet-data

The **[\*TOOLS/QRYEXPORT](https://manual.pvxplus.com/utilities/qryexport)** utility can be used to export data to a spreadsheet-supported file based on a query definition. It can be invoked in your program using the **[CALL](https://manual.pvxplus.com/directives/call)** directive:

```
CALL "*tools/qryexport", queryName$, queryLib$, exportfile$ [, queryopts$, show_flg$]
```

The file has a header record consisting of the column headings defined in the query, followed by data records of the resulting query data set. The file types that are supported are comma separated (*.csv*), tab delimited (*.txt*), symbolic link (.*slk*) and Microsoft XML (.*xml*), dependent upon the extension on the export file name.

There are also options to include hidden query columns and determine interactive run-time behavior.

***Example:***

```
CALL "*tools/qryexport","qClient","panels.en","customer.xml","","PD"
```

![](https://manual.pvxplus.com/migration-assets/12d1b093d1dba1e2b9130cb3cbfbb32ac0c76e54f3f1a28f3aae749fa730b2a0.png)

This code generates an XML file based on the qClient query definition, excludes any hidden columns, displays a progress bar while it is generating the file, and displays the result using the default app (e.g. Excel).
