Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

hadooqlik
New Contributor III

CSV export with Table API on mashup

Hi,

I can export to OOXML format, but when I change to CSV, rpc returns this error

Captura.PNG

with this code:

Captura.PNG

This frame is sent:

Captura.PNG

If I change "CSV_T" with "OOXML" then the table is exported correctly.

I don't find the reason, any suggestion?

Thanks,

JuanJo

1 Solution

Accepted Solutions
Employee
Employee

Re: CSV export with Table API on mashup

Hi Juan,

As swr‌, commented, you should use TableApi's exportData method ‒ Qlik Sense‌.

What you are using in your example is the exportData method from the visualization layout; I am not really sure if this is documented, or "officially exposed"... but the reason why you can export OOXML and not CSV_T or CSV_C file format is that you are missing the second parameter "qPath" see documentation here: ExportData method ‒ Qlik Sense‌ - this parameter is mandatory only for CSV_T and CSV_C.

regards,

aiham

3 Replies
Employee
Employee

Re: CSV export with Table API on mashup

Have a look here:

https://github.com/stefanwalther/sense-extension-recipes/tree/master/tableapi-exportdata-paint

Sent from my iPhone

Employee
Employee

Re: CSV export with Table API on mashup

Hi Juan,

As swr‌, commented, you should use TableApi's exportData method ‒ Qlik Sense‌.

What you are using in your example is the exportData method from the visualization layout; I am not really sure if this is documented, or "officially exposed"... but the reason why you can export OOXML and not CSV_T or CSV_C file format is that you are missing the second parameter "qPath" see documentation here: ExportData method ‒ Qlik Sense‌ - this parameter is mandatory only for CSV_T and CSV_C.

regards,

aiham

Partner
Partner

Re: CSV export with Table API on mashup

Hi...,

 

Try this method.

 

var set = {
qFileType: 'CSV_C',
qPath: '/qHyperCubeDef',
qFileName: 'temp.csv'
}
app.getObject('sxqbWtE').then(function (m) {
console.log(m)
m.exportData(set).then(function (reply) {
console.log(reply)
window.open(reply.qUrl)
})
})