Hello,
I saw in 7.5.2 release notes that aspose now supports Custom Data Sorting but I can’t find any documentation or class name that could help me in implementing such function. Could you tell me where I can find the matching exemple ?
I have to do 2 things, custom sort data in a sheet. And custom sort items in pivot table.
here are the way I do it in excel Interop way :
In an excel output, on one sheet I do custom sort data for the moment using interop excel :
worksheetTb.Select();
worksheetTb.Sort.SortFields.Clear();
worksheetTb.Sort.SortFields.Add(
worksheetTb.get_Range(“Q1:Q9999”),
Microsoft.Office.Interop.Excel.XlSortOn.xlSortOnValues,
Microsoft.Office.Interop.Excel.XlSortOrder.xlAscending,
“ZZZ,SSSS,AAA,DDD,CCC,WWW”,
Microsoft.Office.Interop.Excel.XlSortDataOption.xlSortNormal);
var sort = worksheetTb.Sort;
sort.SetRange(worksheetTb.get_Range(“A1:U9999”));
sort.Header = Microsoft.Office.Interop.Excel.XlYesNoGuess.xlYes;
sort.MatchCase = false;
sort.Orientation = Microsoft.Office.Interop.Excel.XlSortOrientation.xlSortColumns;
sort.SortMethod = Microsoft.Office.Interop.Excel.XlSortMethod.xlPinYin;
sort.Apply();
then in another sheet, in a pivot table I sort Pivot table this way :
excelApp.ActiveSheet.PivotTables(“pivot”).PivotFields(“field1”).ClearAllFilters();
try
{
excelApp.ActiveSheet.PivotTables(“pivot”).PivotFields(“field1”).PivotItems("(blank)").Visible = false;
}
catch (Exception)
{
}
try
{
excelApp.ActiveSheet.PivotTables(“pivot”).PivotFields(“field1”).PivotItems(“ZZZ”).Visible = true;
}
catch (Exception)
{
}
try
{
excelApp.ActiveSheet.PivotTables(“pivot”).PivotFields(“field1”).PivotItems(“SSSS”).Visible = true;
}
catch (Exception)
{
}
try
{
excelApp.ActiveSheet.PivotTables(“pivot”).PivotFields(“field1”).PivotItems(“AAA”).Visible = true;
}
catch (Exception)
{
}
…
If you have any Idea how to do it with aspose, I would be happy to read this.
Regards,
Thierry