Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
In my extension, I'm using an API call to fetch some details from other service and render the different UI based on the response. The issue is when I try to export as image, Qlik sense rendering before my UI gets rendered.
I tried to setTimeout for the qlik.promise.resolve and I also tried to use qlik.promise.defer to delay the export functionality. Still I couldn't able to render the UI in the image.
Any information is appreciated. Please reply incase of additional information is required.
Thanks,
Manoj
Hi Community,
I found the solution for the issue. we just need to create a delay until the API call is completed.
var Promise = qlik.Promise;
return new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(); // Extension painted successfully
}, 1000);
});
I just used the above code instead of
return qlik.Promise.resolve();
Simply set the time out to 1 sec. (it may cause issue if the API call exceed 1 sec to complete).
Note: Once we included the code, restart the Qlik Printing service. Without restart, it may produce the result based on the previous state which means even if we change the code, it still produces blank page.
Hi @Manoj_Prabu
Are you talking about downloading the image, if so refer to below link:
Also please be more specific about the requirement so we can move in right directions.
Thanks,
Padma Priya
Qlik Support
Hi @PadmaPriya ,
Thanks for the response. Yes, you are right. I'm talking about the export as image, pdf option that available in the context menu.
For the understanding, I'm developing a Qlik sense extension, where I'm using fetch API to get some data from our service, based on which I'll render the UI. There is no issue with the UI, as it gets rendered once it fetches the data from the API service. But when I try to export it as image/pdf, Qlik render the image even before my UI gets rendered. So, it coming as blank. If I remove the API call, then the image is rendering as expected.
Table as Object:
The Exported Image just have nothing.
I referred to the below link to wait until my UI get rendered, but still, I didn't get it properly in the exported image.
promise object | Qlik Sense for developers Help
Whereas the export to data is working properly as it has nothing to do with the UI.
Please let me know any specific kind of information is required.
Thanks,
Manoj
Hi Community,
I found the solution for the issue. we just need to create a delay until the API call is completed.
var Promise = qlik.Promise;
return new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(); // Extension painted successfully
}, 1000);
});
I just used the above code instead of
return qlik.Promise.resolve();
Simply set the time out to 1 sec. (it may cause issue if the API call exceed 1 sec to complete).
Note: Once we included the code, restart the Qlik Printing service. Without restart, it may produce the result based on the previous state which means even if we change the code, it still produces blank page.