# Generating XLS Files

**URL:** https://community.linx.software/community/t/generating-xls-files/417
**Category:** How To
**Created:** [May 30, 2019, 8:36am UTC](https://community.linx.software/community/t/generating-xls-files/417 "2019-05-30T08:36:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)
#### Post date: [May 30, 2019, 8:36am UTC](https://community.linx.software/community/t/generating-xls-files/417/1 "2019-05-30T08:36:12Z")

</div>

A scenario may arise where you need generate an Excel 97 file (.xls) for certain systems. Currently in Linx, there exists an Excel plugin which allows one to read/write excel spreadsheets using the built in functions, however this only works with the (.xlsx) format.

There is however a workaround in Linx which allows one to generate (.xls) files. It works by converting the data for the file into Bytes and writing it to a file which will be (.xls).

Linx 5 - [WriteExcelFileXLS.lsoz](https://community.linx.software/uploads/default/original/1X/b6660746e2394b551c449a892f2a9e3903dd35cc.lsoz) (12.0 KB)  
Linx 6 - [Linx6.zip](https://community.linx.software/community/uploads/short-url/9usJUXmSdN4w0P6Jo9iJm5OY248.zip) (16.3 KB)

  
Please note the terms ‘Process’ and ‘Custom Type’ have been depreciated and have been replaced with ‘Function’ and ‘Type’ respectively. More details [**here**](https://linx.software/docs/releasenotes/linx/5.20.2.0/).
  

**CustomTypes –** To hold the data values that will be written into the file  
_RowColValue\_Record_ – Holds the location and value of the cell  
Fields:

- 

```
Col: integer

```

- 

```
Row: integer

```

- 

```
Value: string

```

_RowColValue\_List_ – Holds a list of Record types  
Field: RowColValue\_List: List\<Project.CustomTypes.RowColValue\_Record\>  
What this means is that the custom type will be of type ‘List’ and the ‘List’ is made up of items of the type ‘CustomType \> RowColValue\_Record’

**ExcelProcesses:**

- addString\_RowCol: Concatenates the values passed in and returns them as a list of bytes
- writeExcel: Adds the returned Bytes from above and creates the actual file.

**RunProcess:**

- RunProcess: This ~~process~~ [_Function_](https://linx.software/docs/releasenotes/linx/5.20.2.0/) integrates all the above functions in a real-world example of reading from a database and passing through the fields to get written into an .xls file. Use this ~~process~~ [_Function_](https://linx.software/docs/releasenotes/linx/5.20.2.0/) as a base to understand how to use the Excel writing workaround.

You will need to configure the DB connection string appropriately if you want to test with the example.

_Thanks to Koos van Staden for the great solution._
