Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Valued Contributor

how to make html table from data


My requirement is to extract data from a Sense app to pdf, for tables with lots of rows.

Since it's not possible from the app, i think about doing it in a a mashup by doing a table from data, and then print the html page to pdf.

But can't achieve to retrieve data from hypercube to hmtl...

Does someone have an working example of how to do that kind off requirement ?

Tags (1)
1 Reply
Not applicable

Re: how to make html table from data


An exemple how hypercubes works and how to create a table

This function create a table

function createCubebox( t ){  //t is the ID where I insert my table, here t = "#table" because I alread declare my table in //the html code, like <table id="table"></table>


  "qInitialDataFetch": [


  "qHeight": 50, // Number of values who are load for each field

  "qWidth": 2    // Number of measures and dimensions



  "qDimensions": [


  "qDef": {

  "qFieldDefs": [

  "Item"     //First Dimension replace item by your first dimension field



  "qNullSuppression": true





"qDef": {

  "qFieldDefs": [

  "Item"   //First measure replace item by your first measure field


  },"qSortBy": {  

              "qSortByState": 0,

              "qSortByFrequency": 0,

              "qSortByNumeric": -1,

              "qSortByAscii": 0,

              "qSortByLoadOrder": 0,

              "qSortByExpression": 0,

              "qExpression": {

                "qv": ""


"qLibraryId": "ID" // if you generate your hypercube, he add this id for the field



  $(t).empty(); //clear the section

  var e=u.qHyperCube,    //



  title1="first title",

  title2=e.qMeasureInfo[0].qFallbackTitle;  //get the name of the field for the second title




   var i=this[0], //the first value of the first field, here a dimension

   g=this[1], //the first value of the second field, here a measure

   f=document.createElement("tr"), //create the row

   d=document.createElement("td"), //create the first cell of the row

   d2=document.createElement("td"); //create the second cell of the row


  }); //add text to the first cell and append the cell to the row

   $(d2).html(g.qNum).appendTo($(f)); //add text to the second cell and append the cell to the row

   $(f).appendTo($(o));  //append the row to the tbody





  createCubebox("#table"); // call the function with the ID