Copying entire Pivot table data into an html object/tabular form

Hello Team,
Is it possible to copy Pivot table data present in an excel into a tabular form/html directly?

@sourav24,

I think you may simply convert the Excel file (containing the pivot table report/data) to HTML, see the following sample code for your reference:
e.g.
Sample code:

// Creating a Workbook object
  Workbook workbook = new Workbook("e:\\test2\\Book1.xlsx");
// Save in Html format
workbook.save("e:\\test2\out1.html", SaveFormat.Html);

Alternatively, you may copy/paste pivot table report to a new worksheet using Range.copy method and then render that sheet to HTML.

1 Like