Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Dec 17, 2024 12:29 pm

Hi-

I want to hide entire pivot table set of columns created using the following code...

pt.DataFields.Add(pt.PivotFields["Rode"], "Rode", SubtotalTypes.Sum);
pt.DataFields.Add(pt.PivotFields["OnTime"], "OnTime", SubtotalTypes.Sum);

I want to hide "Rode" and "OnTime" after calculating their column total.

Thanks
-Tom

trozzi1957
 
Posts: 14
Joined: Sun Oct 14, 2018 10:58 pm

Tue Dec 17, 2024 12:35 pm

I want to uncheck the columns showing the datafields on the report boxes programmatically... the checkboxes are in the right panel.

trozzi1957
 
Posts: 14
Joined: Sun Oct 14, 2018 10:58 pm

Wed Dec 18, 2024 6:36 am

Hi Tom,

Thanks for your inquiry.

Please refer to the following code:
Code: Select all
var c1 = pt.PivotFields["Rode"];
c1.Axis = AxisTypes.Column;
pt.DataFields.Add(pt.PivotFields["Rode"], "Rode", SubtotalTypes.Sum);
pt.CalculateData();
((XlsPivotField)c1).HideAllItem(true);


If this does not meet your requirements, please let me know and provide me with a sample document or screenshot showing the desired outcome. I will do further investigation. Thank you for your assistance.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2998
Joined: Wed Jun 27, 2012 8:50 am

Mon Dec 23, 2024 7:08 am

Hello,

Hope you are doing well.

Has your issue been solved?

I look forward to receiving your feedback.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2998
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.XLS