Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
SwenWa
Partner - Contributor II
Partner - Contributor II

Export formatted (excel) data via API (javascript mashup)

Hi team,

There is the possibility to export formatted data to excel (data settings: table formatting)

Is it also possible to do this via API? 

Thanks, Swen 

Labels (1)
  • API

1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

Hi @SwenWa, it is possible to export data with formatting directly from a Qlik App checking below checkbox before export

 

Unfortunately, there is no way to do this via API with Capability APIs in Client Managed version.
 

If you are using Qlik SaaS, this is the API you need for export excel with formatting

View solution in original post

5 Replies
alex_colombo
Employee
Employee

Hi @SwenWa, it is possible to export data with formatting directly from a Qlik App checking below checkbox before export

 

Unfortunately, there is no way to do this via API with Capability APIs in Client Managed version.
 

If you are using Qlik SaaS, this is the API you need for export excel with formatting

bander04
Contributor II
Contributor II

@alex_colombo - 

 

Do you all have an example of how to utilize the reports api to export an object (straight or pivot table) to Excel? 

Rodlibar
Contributor II
Contributor II

HI,  do you know how to export a cvs file from script? (saas)

alex_colombo
Employee
Employee

@bander04  this is an example for exporting an excel from a visualization.

You need to set your tenant host name, webIntegrationId (if you are using this kind of authorization), visualization id, temporaryBookmark and crsf token for authroizate POST requests.

In the response you will find the end point for monitoring the generation status. You have to make a GET requests for checking when report is ready, then when it is complete, you can download it.

const vizId = 'dfXmJ'
const reportSettings = {
	"type": "sense-data-1.0",
	"senseDataTemplate": {
		"appId": appId,
		"id": vizId,
		"selectionType": "temporaryBookmarkV2",
		"temporaryBookmarkV2": {
			"id": tempBookmark
		}
	},
	"output": {
		"outputId": "Chart_excel",
		"type": "xlsx"
	}
}

//Generate Report
const report = await fetch(`https://_yourTenantHost_/api/v1/reports`, {
	method: "POST",
	credentials: "include",
	headers: {
		"Content-Type": "application/json",
		"Qlik-Csrf-Token": csrfToken,
		"Qlik-Web-Integration-Id": webIntegrationId
	},
	body: JSON.stringify(reportSettings),

})

//Get status url for monitoring report generation status
const reportStatusLocation = report.headers.get('Content-Location')
//Check Report APIs status end point for understanding when report is ready to be downloaded

 

alex_colombo
Employee
Employee

Hey @Rodlibar you cannot export data as csv, this is not supported yet and will be remove from our docs.