1 Reply Latest reply: Jan 10, 2018 6:48 AM by Jesper Snihs RSS

    How to export data on qliksense mashup

    junzai xiao

      Hi all,pls tell me how to export data on qliksense mashup,can not be exported by clicking the right mouse button or with an extension without any restrictions,thank you!

        • Re: How to export data on qliksense mashup
          Jesper Snihs

          Hi Junzai,

          The code I will display is not the complete code but I will try to guide you through the example.

          This is how I have solved it:


          In the .js file I have the following function and this is being called everytime a user right-click on a container with the class "right-click-toolbar". Right-clicking on this container brings up a modal with some options. One of the option is the export data link:

          $( ".right-click-toolbar" ).contextmenu(function(event) {
              var containerID = $(this).find("[data-qvobject]").attr('id');
              var qlikObjects = setObjects.toString();
              if(qlikObjects.indexOf(containerID) != -1){
                  var tmpString = qlikObjects.substr(qlikObjects.indexOf(containerID), qlikObjects.length); 
                  var ptrn = /(\d+|\w+|-_)/g;
                  var match, qlikID;
                  var test = ptrn.exec(tmpString);
                  if((match = ptrn.exec(tmpString)) != null){
                      qlikID = match[0];
              $( ".export-data-link" ).attr({
                  'qvdata-id': qlikID

          So what we do here is to find the id of the container that has the QV-object and attach that ID to the export link.


          Next part of the the .js-file handles when the user clicks the export button:

          $( ".export-data-link" ).click(function(event) {
              var qlikID = $(this).attr("qvdata-id");
          var exportObject = function(qvObj){
                app.getObject("export-container", qvObj).then(function(retObj){
                    retObj.exportData( 'OOXML', '/qHyperCubeDef').then(function(c){
                        var d = "../.." + c.qUrl;
                            'filename': "download",
                          'download': true,
                          'href': d


          The HTML looks like this:

          <div class="right-click-toolbar">
              <div id="QV01" class="qvobject" data-qvobject=""></div>


          I have removed a lot of code so it might be so that this will not work as it is since I haven't tested it completely. Let me know if you have any issues.