# exportData method

Information noteSTABLE.   
  
This API is reliable and breaking changes are unlikely.

exportData(options, callback)

Exports data of the underlying hypercube in OOXML or CSV format.

Information noteThe entire hypercube is exported, not just the current data-page.

Information noteDownload to Excel with enhanced table formatting is not supported via the API.

## Version history

Version history

| Version state | Details |
| --- | --- |
| Introduced | 2.1 |

## Parameters

### options

Type: Object

Optional.

Properties:

options object properties

| Name | Type | Description |
| --- | --- | --- |
| format | String | Data format. Can be one of:<br><br><ul> <li><span>OOXML</span>: open XML, default</li> <li><span>CSV_C</span>: comma separated CSV</li> <li><span>CSV_T</span>: tab separated CSV</li> </ul> |
| filename | String | This parameter is optional and only used in desktop.<br><br>Sets the name of the exported file when downloaded.<br><br>Example: filename(guid).xlsx |
| state | String | Can be:<br><br><ul> <li><span>A</span>: all values</li> <li><span>P</span>: possible values (default)</li> </ul> |
| download | Boolean | Automatically start download of file (with window.open). |

### callback

Type: Function

Optional.

Callback function returning the link to the exported file.

## Example

Example:

```
var qTable = qlik.table(this);

var $exportButton = $( document.createElement('button'));
$exportButton.html('Export');
$exportButton.bind('click', function (  ) {
			qTable.exportData({download: true});
		});
$element.append($exportButton);
		
```

Example: Using AngularJS in a Qlik Sense visualization extension.

```

//Main script:
...
paint: function ( ) {
		//setup scope.table
		if ( !this.$scope.table ) {
		this.$scope.table = qlik.table( this );
		}
	}
...

//In your template:
<button ng-click="table.exportData({download:true})">Create Excel file</button>
		
```