1 Reply Latest reply: Jul 7, 2016 3:42 AM by Thibaut Schueller RSS

    how to make html table from data

    Christophe Brault



      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 ?

        • Re: how to make html table from data
          Thibaut Schueller


          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