Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Goodmorning Qlik Community,
I would know if there is a way to export a pivot table object to Excel...I've toke a look to api reference
(exportData method ‒ Qlik Sense)
but I can't understand in which way I can create a qTable from Pivot object.
Thanks for help...
Same here,
if someone can provide an explanation about the cod below and how to implement it it would be excellent,
exportData method ‒ Qlik Sense
*****************************************js*******************************************
******************************************html******************************************
<button ng-click="table.exportData({download:true})">Create Excel file</button>
You can export the data using one of the below methods.
Method 1 :- Pass the html element id ('QV06') and qlik sense object id ('uETyGUP') as shown below.
require(["js/qlik"], function (qlik) {
app.getObject('QV06', 'uETyGUP').then(function (visual) {
var qTable = qlik.table(visual);
qTable.exportData({ download: true });
});
});
Method 2 :- Create table by passing the hypercube dimensions and measured and export the table.
// Get current app.
var app = qlik.currApp($('#QV01'));
// Create table using table API.
var table = app.createTable([{ "qDef": { "qFieldDefs": ["Case Owner Group"], "qFieldLabels": ["Group"] } },
{ "qDef": { "qFieldDefs": ["CaseNumber"], "qFieldLabels": ["CaseNumber"] } }
],
[{ "qDef": { "qDef": "Sum( [Open Cases] )", "qLabel": "Open Cases" } }],
{ rows: 200 });
// Create OnData listener for the table object.
var listener = function () {
debugger;
table.exportData({ download: false }, function (link) {
var url = (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + link
window.open(url, "_blank");
table.OnData.unbind(listener);
});
};
// Bind the listener to the table object.
table.OnData.bind(listener);
Hi Praveena,
I am trying to add a mouse over on export excel icon. I have used exactly the script that you have provided here and export to excel works fine however I am unable to add mouse over on it.
Appreciate your help.
The problem mentioned in the original issue is about Export of data to excel, which works fine for you. The mouse over problem you have mentioned does not look related to Qlik. You can research on how to bind mouse over event listeners in the language or platform of your development.
If you are using jquery then you can follow https://api.jquery.com/mouseover/ or if you are using Angular/React then it varies.
Thanks for your prompt response. Mouse over is in mash up Qlik Sense. I am not familiar with jquery and javascript hence if you know how to add mouse over in javascript in the same line of script where export to excel has been added. Thanks for your help.
Hello All ,
Could please let me know all color coding in pivot will be export to excel or not.
Thanks in Advance,
Harish