Given a single PivotGrid cell (as PivotCell), is there a quick way to find the items in the FlatDataSource that contributes to that cell?
If one or more dimensions of the FlatDataSource is omitted from the grid, then each cell is the sum of multiple items from the data source. I can from the cell find column and row, and from there the levelnames and values that is agregated into the cell, and finally loop through the item source and check each item for match.
However, with several hundred thousands of items in the source this is time consuming. Is there some place the cell has stored pointers/indexes to the data source items that are accumulated into the cell?
Hi,
I have finally found some time to get back to this issue. I have run a profiling tool on the silverlight application while stressing the pivotgrid by expanding, collapsing and scrolling.
Our display of data relies heavily on metadata attached to each object in the flatdatasource itemsource. Whenever a cell in the grid cell is displayed (CellControlAttached) I examine all the objects in the datasource that is aggregated into the cell. Depending on metadata for each source object the cell is formatted in various ways.
This depends all on the GetCellItemsIndexes of the FlatDataSource. I have attached a graph provided by the profiling tool I use, showing the call stack and timing statistics originating in GetCellItemsIndexes. FormatGridCellForCube is my function to handle the formatting, and as you can see from the graph 99.9% of the time used on formatting is spent calling GetCellItemsIndexes. From there I have expanded selected call branches based on the most time consuming functions.
I hope this information can be of help in your work on optimizing this functionality, which would be highly appreciated. The profiling is based on release 2011-2.
Regards, Mikael
Thanks for your answer, I'm glad to hear that you already are working on this issue.
RE details on the data source we are using, on of our scenarios has the following characteristics:
- Total number of items in flat data source = 768600
- Number of measures = 6
- Number of dimensions = 5 (with 1, 2, 21, 100 and 183 elements pr. dimension respectively)
Over all it seems that the fewer dimensions added to grid, i.e. higher aggregation level, gives faster response times with GetCellItemsIndexes. As dimensions are added or expanded, GetCellItemsIndexes gets slower while returning fewer items.
Applying filters seems to speed things up. With the same data source, if filter is applied to one of the dimensions, effectively hiding a number of items in the data source, then GetCellItemsIndexes works faster at the same aggregation level.
These are my first findings, as I haven't had the time to dig really into it. I', leaving for summer holiday today, but can work a little more on it in August. Let me know if you would need more details.
Hi
We are working to improve the performance in this area. I hope in 11.2 version the feature to work better.
BTW could you write any specific info about your data. How many records, dimensions, measure ect. do you have in your datasource
RegardsTodor
This is long awaited functionality, and I'm glad to finally have it. It works good and let's us format each cell depending on metadata for the aggregated source values.
However, the performance is somewhat slow; depending on the number of flat data source items and on the aggregation level, GetCellItemsIndexes spends some 2-8 seconds on each invocation.
Any toughts on this, or any plans to enhance performance?
Thanks in advance.
Hello,
Here is a snippet of how you can get the items that form the result in particular cell:
FlatDataSource flatDataSource =
(FlatDataSource)this.flatPivotGrid.DataSource;
List<int> itemsIndexes = flatDataSource.GetCellItemsIndexes(cell);
foreach (int itemIndex in itemsIndexes)
{
[YourItemsType] item =
([YourItemsType])flatDataSource.GetRecord(itemIndex);
}
Regards,
PPilev.