Rowfield Subtotal

Hi Aspose support team,

My requirement is

1. need to hide the subtotals for the row field. i can able to hide the subtoal if i used different field for row and data field. But,i have used the same field as row field and data field. i am getting error like " Subtotals are only valid for nondata fields" while i going to hiding the subtotal using the following aspose function - "pivotTable.RowFields[0].IsAutoSubtotals = false;"

2. i have the date field as row field. i want to set the format for the particular row field like "dd/mmm". But i cannot able to achive this one.

Could you please provide the help or sample piece of code to achive this feature.

Thanks in Advance

Regards,

Saravanan K

Hi,

Will you please provide us source and output xls/xlsx files which you can create manually using Ms-Excel to illustrate your problem. We will see how to create the output file of your desired results using the source file with the help of Aspose.Cells API.

Please also help us with screenshots.

Hi Support team,

My requirement is

1. Need to remove the subtotal for the rowfield( i used the same field used for data and row field)

2.Need to change the format for the rowfield.(date field format is dd/mmm)

3.Need to hide the row field title.

Please find the attached sample.xlsx for your kind reference which is contains the data sheet and the output sheet. and i have attached the expected and actual.jpeg images.

Could you please provide the sample piece of code to achieve the feature?

Thanks in advance

Saravanan

Hi,

Thanks for your files and illustration using images. We will look into it and update you asap.

Hi,

Please try this sample code:

C#


wb.Worksheets[0].PivotTables[0].RowFields[0].IsAutoSubtotals=false;

wb.Worksheets[0].PivotTables[0].RowFields[0].ShowInOutlineForm=false;

wb.Worksheets[0].PivotTables[0].ShowRowHeaderCaption=false;

wb.Worksheets[0].PivotTables[0].RowFields[0].NumberFormat=“dd/mmm”;

I have attached the sample file.

Hi Support team,

Thanks for your update. now one issue is solved. but still two issues are existing.

1. if i used this line (wb.Worksheets[0].PivotTables[0].RowFields[0].IsAutoSubtotals=false). i will get the following error message " Subtotals are only valid for nondata fields". Here i have used the same field for roew field1 and data field1. if i used the different field for rowfield1 and datafield1, it is working.

2.Still i cannot able to set the format for rowfield1.(wb.Worksheets[0].PivotTables[0].RowFields[0].NumberFormat="dd/mmm"; )

Thanks in advance

Regards,

Saravanan K

Hi,


After an initial test using your modified template “Source.xlsx” file, I can find the issues (1,2) as you mentioned. I have logged a ticket for the issue with an id: CELLSNET-40013. We will investigate and look into it soon.

Thank you.
Hi,

Please try our latest fixed version: v7.0.2.2, we have fixed this issue.

Please try this sample code to set format to rowfield:

Style style = new Style();
style.Custom = "dd/mmm";
wb.Worksheets[2].PivotTables[0].Format(9, 0, style);
wb.Worksheets[2].PivotTables[0].Format(10, 0, style);
wb.Worksheets[2].PivotTables[0].Format(11, 0, style);
wb.Worksheets[2].PivotTables[0].Format(12, 0, style);

Thank you.

The issues you have found earlier (filed as CELLSNET-40013) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.