Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
Want a clarification on the use case related to Excel Library
posted

Hi

I want a small clarification on one of the use case related to Excel Library. (https://ko.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!!!

Parents
No Data
Reply
  • 34810
    Offline posted

    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.

Children