Is it possible to access the SlicerCacheItem label associated with the option in the Slicer? I need to pre-select a number of different options but when I look in the documentation the only usable property is Selected. I can loop through the index of SlicerCacheItems but because of different sorting, index-0 may not be the item I expect, and I would rather check the label of the option and decided to select or deselect it that way.
The commented-out bit in the following code is what I’m hoping to accomplish:
Worksheet cost = wb.Worksheets[“Cost”];
Slicer yrSlcr = cost.Slicers[“year_slicer”];
SlicerCacheItemCollection items = yrSlcr.SlicerCache.SlicerCacheItems;
List selectedOptions = new List() { “2018”, “2019”, “2020” };
for (int i = 0; i < items.Count; i++)
{
//SlicerCacheItem s = items[i];
//if (selectedOptions.Contains(s.Value.Tostring()))
//{
// s.Selected = true;
//} else
//{
// s.Selected = false;
//}
}
yrSlcr .Refresh();
Obviously, “s.Value” does not exist, but what, if any, options are there for accessing the value or text on the Slicer item?
@mfox,
Please elaborate the issue more by providing sample Excel file, images showing the required information and steps to perform the same task using MS Excel only. We will analyze the information and share our feedback accordingly.
@mfox,
We have further analyzed this requirement and logged it in our database for detailed investigation. You will be notified here once any update is ready for sharing.
This requirement is logged as: CELLSNET-48104 - Get value of SlicerCacheItem in the collection Slicer.SlicerCache.SlicerCacheItems
This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.
The issues you have found earlier (filed as CELLSNET-48104) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao