PivotField. Reading items from cache

Hi,

Is there any way to read original items values for field?
When I'm reading items from field, they may be in different order (for example, sorting) and they may have different values (for example, grouping).

Thank you,

Alex Shloma

Hi,

Thanks for your posting

Please elaborate your problem with sample xls/xlsx files and screenshots or code example.

You can create screenshots and highlight your points with red circles or you can attach a word document with description. It will help us quickly sort out your issue and we might be able to provide you sample code or workaround.

Hi,

We will provide a method to support this issue next aspose version.

We have logged this issue in our database as a New Feature Request. We will update you asap.

This issue has been logged as CELLSNET-40217.

Hi,

Please download: Aspose.Cells for .NET v7.0.4.3

Please using PivotField.OriginalItems to get original items values for field.

Thank you!!! All works fine. Thanks for help.


Best regards,
Alex Shloma

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


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

Hi,


I found two problems:
1. The items from cache are loading only after calling method ‘RefreshData’. As I understand, this method updates the cache from data source, but I need to read current cache state.
2. The items will not be loaded, if field has an empty item.
I created simple document with Pivot Table. It has 5 fields: Region, Product, Jan, Apr, Oct.
Loading items from cache:
1.
Region - loaded
Product - loaded
Jan - not loaded
Apr - not loaded
Oct - not loaded
2.
Region - loaded
Product - loaded
Jan - System.NullReferenceException
Apr - loaded
Oct - System.NullReferenceException
Workbook wb = new Workbook(fName);
foreach(Worksheet ws in wb.Worksheets)
{
foreach(PivotTable pt in ws.PivotTables)
{
// These lines are used only in sample #2
//try { pt.RefreshData(); }
//catch { }

PivotFieldCollection pfc = pt.BaseFields;
for (int i = 0; i < pfc.Count; i++)
{
PivotField pf = pfc[i];
try
{
printLine(“ItemCount(Cache)”, pf.OriginalItems.Length.ToString(), SPACE4); // my inner printing method
for (int j = 0; j < pf.OriginalItems.Length; j++)
printLine(pf.OriginalItems[j], “”, SPACE5);
}
catch
{
printLine(“ItemCount(Cache)”, " ============== ERROR ============== ", SPACE4);
}
}
}
}

Best regards,
Alex Shloma

Hi,


I can notice the issue(s) as you have mentioned by using your template file with sample code.
I have logged a ticket with an id: CELLSNET-40431. We will look into it soon

Once we have any update about your issue, we will let you know here.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.1.1.6

Hi,


Thanks. All works as expected.

Best regards,
Alex Shloma

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


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