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

Free Support Forum - aspose.com

Pivot Tables. Language text other than English

Hello,

Is it possible to change language of text generated by Aspose Cell in C#?
For example - I have Pivot Tables and there are aggregation functions. I would like to get text in Polish language instead of English.

Hi Mateusz,


Thank you for contacting Aspose support.

I think, your requirement may not be possible with current set of the Aspose.Cells APIs, however, we will check the requirement thoroughly and log a feature request in this regard, if required. Please share a sample spreadsheet containing a Pivot Table, and highlight the cells having aggregate functions so we could review it as well as discuss the requirement with the concerned member of the product team.

Ok, I have attached example file.

Hi again,


Thank you for the sample. I need one more clarification, are you creating the Pivot Tables with Aspose.Cells APIs or do you wish to manipulate existing Pivot Tables for this scenario?

I created pivot in Excel. On the server I get new data and refresh pivot data source. Date are correct, only texts are in English.

Hi there,


Thank you for the clarification. Please spare me sometime to discuss this matter with the product team and revert back with updates in this regard.

Hi Mateusz,


This is to update you that I have logged a formal request (CELLSNET-45037) in our database for your requested feature (Support for Custom Total & Grand Total Labels for Pivot Tables). Please spare us some time for the feasibility analysis. Once we have completed the analysis, we will be in a better position to provide an estimated time frame for the implementation. We will keep you posted with updates in this regard.

Hi,


Thanks for using Aspose.Cells.

We will support this feature before the second quarter of 2017. Once, we will have any further news for you, we will update you asap.

Thank you! :slight_smile:


I’ll be waiting for update :slight_smile:
Hi,

Thanks for using Aspose.Cells.

Please download and try the following latest fix

Aspose.Cells for .NET v17.02.7 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.02.7 (.NET 4.0) compiled in .NET Framework 4.0.

and let us know your feedback.
There are some tips for you:

1. If you want to implement the globalization of PivotTable, please extend the “GlobalizationSettings” class and overwrite the methods.

2. Please see the following sample code. It overrides only necessary methods and set the polish texts but you can implement all the methods as needed.


C#
Workbook wb = new Workbook(filePath + "pivot+table+sample.xlsx");

//Setting the custom globalization class
wb.Settings.GlobalizationSettings = new CustomGlobalPolish();

PivotTable pt = wb.Worksheets[1].PivotTables[0];
pt.RefreshDataFlag = true;
pt.RefreshData();
pt.CalculateData();
pt.RefreshDataFlag = false;

PdfSaveOptions options = new PdfSaveOptions();
options.OnePagePerSheet = true;

wb.Save(filePath + “out_polish.pdf”, options);

//----------------------------------------------------------------
//----------------------------------------------------------------
//----------------------------------------------------------------
//----------------------------------------------------------------
//----------------------------------------------------------------

private class CustomGlobalPolish : GlobalizationSettings
{
///


/// Gets the name of “Total” label in the PivotTable.
/// You need to override this method when the PivotTable contains two or more PivotFields in the data area.
///

/// The name of “Total” label
public override string GetPivotTotalName()
{
return “Total”;
}
/// <summary>
/// Gets the name of "Grand Total" label in the PivotTable.
/// </summary>
/// <returns>The name of "Grand Total" label</returns>
public override string GetPivotGrandTotalName()
{
    return "Suma końcowa";//polish
}

/// <summary>
/// Gets the name of "(Multiple Items)" label in the PivotTable.
/// </summary>
/// <returns>The name of "(Multiple Items)" label</returns>
public override string GetMultipleItemsName()
{
    return "(Multiple Items)";
}


/// <summary>
/// Gets the name of "(All)" label in the PivotTable.
/// </summary>
/// <returns>The name of "(All)" label</returns>
public override string GetAllName()
{
    return "(All)";
}


/// <summary>
/// Gets the name of "Column Labels" label in the PivotTable.
/// </summary>
/// <returns>The name of column labels</returns>
public override string GetColumnLablesName()
{
    return "Column Labels";
}


/// <summary>
/// Gets the name of "Row Labels" label in the PivotTable.
/// </summary>
/// <returns>The name of row labels</returns>
public override string GetRowLablesName()
{
    return "Row Labels";
}


/// <summary>
/// Gets the name of "(blank)" label in the PivotTable.
/// </summary>
/// <returns>The name of empty data</returns>
public override string GetEmptyDataName()
{
    return "(blank)";
}

/// <summary>
/// Gets the name of <see cref="PivotFieldSubtotalType"/> type in the PivotTable.
/// </summary>
/// <param name="subTotalType">The <see cref="PivotFieldSubtotalType"/> type</param>
/// <returns>The name of <see cref="PivotFieldSubtotalType"/> type</returns>
public override string GetSubTotalName(PivotFieldSubtotalType subTotalType)
{
    switch (subTotalType)
    {
        case PivotFieldSubtotalType.Sum:
            return "Suma";//polish

        case PivotFieldSubtotalType.Count:
            return "Count";

        case PivotFieldSubtotalType.Average:
            return "Average";

        case PivotFieldSubtotalType.Max:
            return "Max";

        case PivotFieldSubtotalType.Min:
            return "Min";

        case PivotFieldSubtotalType.Product:
            return "Product";

        case PivotFieldSubtotalType.CountNums:
            return "Count";

        case PivotFieldSubtotalType.Stdev:
            return "StdDev";

        case PivotFieldSubtotalType.Stdevp:
            return "StdDevp";

        case PivotFieldSubtotalType.Var:
            return "Var";

        case PivotFieldSubtotalType.Varp:
            return "Varp";

    }

    return "Suma";//polish
}

}


The issues you have found earlier (filed as CELLSNET-45037) have been fixed in Aspose.Cells for .NET 17.3.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.