0

Multiple Webdatarocks pivots gives exception

"is not a constructor at displaygrids"

script is included properly but no resolution.. There is also & issue on how to differentiate export of data for both grids separately when on the same page.

Following is the code :

'''
function displaygrids(parsed_data,parsed_data_2) {

  var pivot = new webdatarocks({
    container: "#d1-component",
    //toolbar: true,
    //  beforetoolbarcreated: customizeToolbar,
    //height: 295,
    report: {
      dataSource: {

        data: parsed_data,
            }
         }
   });


  var p1= new webdatarocks({
          container: "#d2-component",
          //toolbar: true,
          //  beforetoolbarcreated: customizeToolbar,
          //height: 295,
          report: {
            dataSource: {

              data: parsed_data_2,
                }
            }
        });
  }
'''
learner
  • 29
  • 4

1 Answers1

1

here is a reference to the WebDataRocks thread with a similar question - https://www.webdatarocks.com/question/how-to-put-pivottable-in-bootstrap-grid/ .

They placed 2 WebDataRocks in a row with a help of Bootstrap.

dima_z
  • 38
  • 1
  • 6
  • Thank you. This is helpful but the challenge is identifying exporttoexcel or pdf how to differentiate between two pivots? Pivot1.exportto('excel')? – learner Mar 22 '21 at 17:16
  • 1
    Referring to the sample in the thread, pivot1.exportTo("pdf"); - will export the first pivot and pivot2.exportTo("pdf"); - will export the second one. You can add 2 buttons with the appropriate handlers to check it. – dima_z Mar 23 '21 at 07:43
  • This is accurate. This has helped in resolving the issue with print functionality. – learner Mar 24 '21 at 09:19