How to properly localize "Months" grouping field?

The following code creates a group PivotField named “Months”.

pivotTable.SetManualGroupField(pivotField, startDate, endDate, new System.Collections.ArrayList() { PivotGroupByType.Months, PivotGroupByType.Days }, 1);

I understand it’s possible to change the DisplayName, but the Name property is read-only. When the file is created in Excel, the Name of the group field is localized properly.

PivotGlobalizationSettings does not appear to provide a way to override the hard-coded name “Months”.

Is there any way to specify the Name for Group fields?

@bingxie
You can search for the corresponding PivotField object by grouping names, and then customize the name by setting the PivotField.DisplayName property. Please refer to the attachment (23.0 KB).

The sample code as follows:

Workbook wb = new Workbook(filePath + "test.xlsx");
PivotTable table = wb.Worksheets[0].PivotTables[0];
PivotField monthField = table.RowFields["Months"];
monthField.DisplayName = "Custom Month";
wb.Save(filePath + "out_net.xlsx");

Hope helps a bit.

Thanks @John.He .

As mentioned in the original post, I understand we can modify the DisplayName. However, we need to change the Name property for this specific file to be compatible with certain screen readers.

When we create the Grouping in Excel, the Name property is localized. How do we change the Name property to match Excel?

Change Display Name via Aspose:

Create Grouping in Excel:

DisplayName.png (3.6 KB)
Excel.png (2.7 KB)

@bingxie
Thank you for your feedback and detailed information. We can understand your needs very well. You need to localize the names of grouped fields (such as Months, Years, Days and so on).

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-54422

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@bingxie,

We are pleased to inform you that your issue has been resolved and the fixed functionality will be released with version 23.11. If you need this feature/enhancement urgently, you can ask and get hotfix from paid support desk.

The issues you have found earlier (filed as CELLSNET-54422) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi