Hi
I want a small clarification on one of the use case related to Excel Library. (https://es.infragistics.com/products/ignite-ui-react/react/components/excel-library)
We have added GroupDescription and SummaryDescription on the grid. We want to know how can we Export this type of grid data to Excel with grouping and summary on the top of each group.
So, for this I need to know how can we achieve that.
Hoping for a positive response.
Thanks!!!
Hello Shubham,
I have been investigating into the behavior you are looking for, and you can get the group-by rows and the summaries applied to them by using the actualDataSource property of the grid and its getItemAtIndex property. If the item at the index is a group-by row, this method will return an element of type DataSourceSpecialRow, which then has a sectionValues property to get the values that were grouped on and a summaryResults collection for the summaries applied. For example, the following loop can get you all of the rows in the grid:
for(let i=0; i<this.grid.actualDataSource.actualCount; i++){ let item = this.grid.actualDataSource.getItemAtIndex(i);
if(item.$$isSpecialRow){ let specialRow: DataSourceSpecialRow = item as DataSourceSpecialRow; let groupValues = specialRow.sectionValues; let summaryValuesForGroup = specialRow.summaryResults;
} else{ //regular data item } }
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew,
Thank you for your response.
we are getting a small issue here.
Groups Collapse
Groups Expanded
If the groups are Expanded as we can see in Screnshot-2 then we are able to get all the rows and Export is working fine in that case.
But when the groups are Collapsed then we are not able to get the data inside each groups.
we have group inside group as we have set groupHeaderDisplayMode="Split". So we want to know how we can get the group inside group and the data inside each group when the groups are Collapsed.
Thanks.