Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
venkey2847
Contributor II
Contributor II

JavaScript with extensions

Hi all,

I have one query: to create extension, we need to write JavaScript. extensions are like to create custom charts.

What is the relationship between JavaScript and extensions.

Don't hesitate on my question.

And I have following queries.

I want export my charts to excel by using JavaScript.

I know we can write macros to export to excel.

But I want to use JavaScript to export.

Please help me out on this.

Thanks in advance.

Regards

Venkey.

3 Replies
nicu1996
Contributor III
Contributor III

If you want to export your visualization as table, you can do something like this:

* inject "qlik" in your extension: function (qlik, ...)  {}

* create a variable for the current app: var app = qlik.currApp(this);

* by using the getObject method, you can create a Qlik Sense object: getObject method ‒ Qlik Sense Developers

Example:

var elem_id, // the id of the HTML element

     chart_id, // the id of the chart

     btn_id; // the id of the "download" button.

var object = app.getObject(elem_id, eval(chart_id));

object.then(function(model) {

var table = new qlik.table(model);

    $('#btn_id').on('click', function(e) {

  e.preventDefault();

      table.exportData({download: true});

    })

});

lorenzoconforti
Specialist II
Specialist II

Hi Venkey

I found these links very interesting when I researched how to build extensions:

Extensions

http://www.qliktips.com/2011/01/beginners-guide-to-qlikview-extension.html

http://qlikcommunity.s3.amazonaws.com/misc/index.html

Hope it helps

ajaykakkar93
Specialist III
Specialist III

hi,

You can go throw this video and try it yourself.

#8 Basic Export Method - YouTube

OR

https://www.youtu.be/Ppz27X1TrIA

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting