Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to include "Export data" feature in a mashup

Hi everyone. I am new to creating mash ups and was wondering if I could get a solution to a issue I have come across.

I created a mashup using Qlik Sense Server Workbench. This mashup contains a table object from one of the sheets in my app. When accessing the sheet via the HUB, right clicking on the table shows an Export Data option for this table object. Is there a way for me to include this feature for this table in my mashup?

Thanks!

1 Solution

Accepted Solutions
Stefan_Walther
Employee
Employee

Hi,

here's an example how you could do that. This functionality is currently not documented nor supported, but in the next version of Qlik Sense it will be there:

Html:

<button id="cmdExport" style="display:none;">

   Export data

</button>

<div id="QV01" style="position: absolute; top: 50px; left: 20px; width: 200px; height: 200px;" class="qvobject"></div>

JavaScript:

require( ["js/qlik", "jquery"], function ( qlik, $ ) {

   qlik.setOnError( function ( error ) {

      alert( error.message );

   } );

  var app = qlik.openApp('Executive Dashboard.qvf', config);

  app.getObject('QV01','NaKQwM').then( function( vizModel ) {

      // Prevent clicking on the button too early

      $('#cmdExport').show();

      $('#cmdExport').on('click', function() {

         vizModel.exportData().then(function( reply ) {

            console.log('qUrl', reply);

            window.open(reply.result.qUrl);

         });

      })

   });

} );

View solution in original post

27 Replies
Not applicable
Author

Teena,

Have a look at the Engine API.  In particular, this link here: http://help.qlik.com/sense/en-us/developer/#../Subsystems/EngineAPI/Content/WorkingWithAppsAndVisual...

Basically, you can create a hypercube (potentially hook into the hypercube of the object) and export the data from there.

Aiham_Azmeh
Employee
Employee

Hi Jeffrey,

Can you make an example? It will be great to share it.

aiham

Not applicable
Author

Hi Jeffrey,

Can you please provide an example for mashup content here? We need this feature to make mashups more useful.

Ramendra

Stefan_Walther
Employee
Employee

Hi,

here's an example how you could do that. This functionality is currently not documented nor supported, but in the next version of Qlik Sense it will be there:

Html:

<button id="cmdExport" style="display:none;">

   Export data

</button>

<div id="QV01" style="position: absolute; top: 50px; left: 20px; width: 200px; height: 200px;" class="qvobject"></div>

JavaScript:

require( ["js/qlik", "jquery"], function ( qlik, $ ) {

   qlik.setOnError( function ( error ) {

      alert( error.message );

   } );

  var app = qlik.openApp('Executive Dashboard.qvf', config);

  app.getObject('QV01','NaKQwM').then( function( vizModel ) {

      // Prevent clicking on the button too early

      $('#cmdExport').show();

      $('#cmdExport').on('click', function() {

         vizModel.exportData().then(function( reply ) {

            console.log('qUrl', reply);

            window.open(reply.result.qUrl);

         });

      })

   });

} );

Not applicable
Author

Hi,

Please what is vizModel?

Stefan_Walther
Employee
Employee

It is the model of the visualization object.

Not applicable
Author

Okay, thanks. I tried to follow your example, but it didn't work. Please what am I doing wrong?

Stefan_Walther
Employee
Employee

As mentioned before, the above illustrated solution is not officially supported.

Starting with Qlik Sense 2.1 (which will be available soon) a new Client API will be available the so called "Table API" which then allows export of data:

var qTable = qlik.table(this); 

var $exportButton = $( document.createElement('button'));

$exportButton.html('Export');


$exportButton.bind('click', function (  ) {

     qTable.exportData({download: true});

     });

$element.append($exportButton);

More about the Table API will then be available in the official documentation of Qlik Sense 2.1

Not applicable
Author

Oh, now I understand you, so it can't work yet until version 2.1? We will wait till then. However am I on the right path from the code I posted.