Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do i Use Qlik Nprinting API to generate a report on a Mashup

Hello everyone,

I've been trying to create a logic that allows me to generate a Nprinting report using the Qlik Nprinting API by clicking a button on my mashup (something similar to the extension that exists but that works on a mashup framework):

I've already checked the option of on demand request on the nprinting server.

teste1.PNG

Below you'll find my Javascript code for this button. The login works fine and the connection is made so i assume there is some wrong syntax:

$scope.Teste = function(){

           var URL = 'https://SERVERNAME/'+ 'api/v1/login/ntlm'

return $.ajax({

url: URL,

method: 'GET',

xhrFields: {

withCredentials: true

}

}).done(function(data) {

               $.ajax({

                        type: "POST",

                        url: 'https://SERVERNAME/api/v1/ondemand/requests/',

                        xhrFields: {

                            withCredentials: true

                        },

                        contentType: 'application/json',

                        data: {

                        type: 'report',

                        config: {

                            reportId: '51eed116-78df-4cee-9270-1a17bf60a005',

                            outputFormat: 'xls'

                        }

                        }

       }).done(function(data) {

                    console.log(data);

                    });

});

};

Right now i'm just trying to get a static report that exists on the server but i'm getting error 400: Bad request.

Thank you

1 Reply
microland
Contributor III
Contributor III

Hi,

Facing the same issue, do u have any solution to this?