0 Replies Latest reply: Apr 25, 2017 5:52 AM by David Farache RSS

    exportData not working for a native object inside of an extension

    David Farache

      Hello,

       

      I have developed an extension which takes Object IDs of existing native Qlik Sense visualizations and renders them within different types of containers.

       

      Now I would like to make it possible to export the data of the Qlik Sense visualizations, so I have started playing around with the exportData property, as described in exportData property ‒ Qlik Sense

       

      The first think I noticed when doing so was that the layout.qHyperCube object was empty because it refers to the extension object, which takes no hypercube. So what I did was to overcome this issue was to copy the qHyperCube of the object I want to export into the layout object of the extension using the following piece of code:

       

      qlik.currApp().getObjectProperties(qvid).then(function(result){
          layout.qHyperCube = result.layout.qHyperCube;
      
          result.getHyperCubeData('/qHyperCubeDef', [{
                qTop: 0,
                qLeft: 0,
                qWidth: 10,
                qHeight: 1000
          }]).then(function(data){
                layout.qHyperCube.qDataPages = data.qDataPages;                           
          });
      });
      
      

       

      This seems to work because when exportData function is called, the layout contains the qDataPages as I need them. In spite of this, I am getting the following error message:


      Export failed. There is no data to export. Please make sure the data in your visualization is correct.


      I have tried other alternative approaches such as modifying the qHyperCube of the layout of the extension using the backendAPI instead of copying directly the information in the frontend but even then I get the same error. What am I missing?

       

      Thanks,

      David