Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem with export to Excel/csv

Hi, i have a problem with the export of a qlikview graph or table into excel or csv. It goes through the function, I get no errors, but it does not actually export. I use this in a SharePoint solution.

Here is my code:

Here the functions that are called when on button clicked

ExportCSVQV: function (e) {

        AZLData.HideCtx(e);

        DoActionQvWebPart(e, "EC");

    },

  

    ExportExcelQV: function (e) {

        AZLData.HideCtx(e);

        DoActionQvWebPart(e, "XL");

    },

function DoActionQvWebPart(webPartPrintButton, action, binder) {

    // action - "CA": Clear All Selection; "PR": Print; "XL": Send to Excel; "EC": Export (CSV)

    if (!binder) {

        binder = Qv.GetDocument().binder;

    }

    // Get QV object id's

    var webPartDiv = AZLjQuery(webPartPrintButton).parents(".ms-webpart-chrome:first");

    var webPartBodyDiv = webPartDiv.find(".ms-WPBody").children(":first");

    var qvObjectIdList = AZLjQuery.map(webPartBodyDiv.find(".QvTable[avqtable]"), function (n) { return "Document\\" + AZLjQuery(n).attr("avqtable") });

    //It is not a table it is a graph

    if (qvObjectIdList.length == 0) {

        var QVObject = webPartBodyDiv.find(".QvFrame:visible");

        qvObjectIdList = AZLjQuery.makeArray((QVObject.attr("ExportObject") == undefined || QVObject.attr("ExportObject") == "") ? QVObject.attr("id").replace("\\", "\\EXP_") : (QVObject.attr("ExportObject").indexOf("Document\\") == 0 ? QVObject.attr("ExportObject") : QVObject.attr("ExportObject")));

    }

    // Execute action

    AZLjQuery.each(qvObjectIdList, function (i, qvObjectId) {

        if (qvObjectId.substring(0, 9) == "Document\\") {

            qvObjectId = qvObjectId.substring(9);

        }

        setTimeout(function () { binder.Set(qvObjectId + "." + action, { action: "" }); }, 2000 * i);

    });

}

0 Replies