We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The columns are not being added to the pivot table

We are trying to generate the pivot table from the excel datasheet and we are missing the columns in the column field and the Data field. Here is the Sample code we are using to generate pivot table.

Code and excel.zip (18.9 KB)

@Mayank.Joshi,

Thanks for the code segment and details.

After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template file. I found that some pivot fields are not added to column and data sections in the pivot table report. I used your template file’s first sheet as data source and created the pivot table in a new sheet. We need to evaluate your issue in details. It is quite possible that your code might needs to have little tweak. Anyways, I have logged a ticket with an id “CELLSJAVA-43159” for your issue. We will look into it soon.

Once we figure it out, we will update you.

@Mayank.Joshi,

We evaluated your issue in details. We found some string data in the columnlist and datalist are not matched the CacheField’s names. So some pivot fields are not added to column and data sections.
Please change the following lines of code code:
e.g

columnlist.add("Current Month Name");
datalist.add("QTR Qty Received");

to:

columnlist.add("Current Month Name ");
datalist.add("QTR Qty Received ");

Please try it and let us know if you still find any issue.