5 Replies Latest reply: Mar 8, 2017 11:49 AM by Thibaut Lorimier RSS

    Export to image and App API not working

    Thibaut Lorimier

      Hello community,

       

      I found some problem with Qlik Sense (working on QS 3.1) with the export to image (or pdf) function for an extension object.

       

      The export is working just fine for the extension if you don't use external elements (as written inside the documentation) :

      The following limitations apply:

      • Qlik Sense does not support exporting or printing of visualization extensions that use external resources.
      • Qlik Sense does not support exporting or printing of visualization extensions that use internal and undocumented JavaScript modules or APIs.
      • When exporting as an image, the maximum size that can be exported is 2,000 by 2,000 pixels. If the export would result in a larger image, the user must reduce the size under Custom in the Export as an image dialog in the app.

       

       

      So my question here is : why the export is not working when you are using some function of the App API (like createCube) ?

       

      Or does Qlik Sense not support his own API (like the App API) for the export ?

       

      Do you have the same problems ? Or maybe there is a workaround to export with the App API ? Or maybe i'm not reading correctly the documentation ...

       

      Regards,

      Thibaut

        • Re: Export to image and App API not working
          Alexander Karlsson

          Because when printing occurs a snapshot (a copy of the layout) is taken of the object and sent to the printing service.
          The printing service then renders the object without a connection to QIX and produces a image. So if you are relying on a connection to the Engine inside the paint function then printing will fail. You probably want to push operations like that into the controller and let your paint function be stateless.

            • Re: Export to image and App API not working
              Thibaut Lorimier

              Ok for the context, i understand now why it's not working.

               

              For the part about the controller and paint stateless i'm a little confused.

               

              What i understand is :

               

              - You can use Angular JS or not to render your extension.

               

              First case : Use only paint function

              In this case the only we have only the paint function and we must call inside the paint our different API to get some element like the createCube function that allow us to query an hypercube each time the paint is called.

               

              With this kind of method

                 return { // Define what our properties panel look like definition: { }, //Paint resp.Rendering logic   paint: function ( $element, layout ) {  } };

               

              With what you explained it means that the extension cannot be compatible with the export and use some element of the API (in my case createCube) at the same time.

               

              Second case : Use AngularJS to render the extension

              In this case i'm not very sure but you render your extension with this kind of method

              define( [ 'angular' ], function ( angular ) {  return { ... controller: ['$scope', function ( $scope ) { $scope.angularVersion = angular.version; }] }; } );

               

              In this case you work inside the controller function but there is no paint element, or i'm missing something ?

               

              Or maybe like you said there is 2 different function : a controller and a paint element (that must be stateless to work with export). I don't use too much the AngularJS case, the controller function is called each time there is a paint ? Or only once during the init of the extension ?

               

              Thanks for your reply !

               

              Regards,

              Thibaut