{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/react-data-grid/excel-export-customising-content/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"h2","properties":{"id":"customising-cell-and-row-group-values","style":"position:relative;"},"children":[{"type":"text","value":"Customising Cell and Row Group values"},{"type":"element","tagName":"a","properties":{"href":"#customising-cell-and-row-group-values","ariaLabel":"customising cell and row group values permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The grid cell and row group values exported to Excel can be customised using the following function params for a call to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"exportDataAsExcel"}]},{"type":"text","value":" API method or in the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"defaultExcelExportParams"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\n| gridApi.exportDataAsExcel({\n|     processCellCallback(params) {\n|         const value = params.value\n|         return value === undefined ? '' : `_${value}_`\n|     },\n|     processRowGroupCallback(params) {\n|         return `row group: ${params.node.key}`\n|     }\n| })\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"interface-documentation","properties":{"interfacename":"ExcelExportParams","names":"[\"processRowGroupCallback\", \"processCellCallback\"]","config":"{\"description\":\"See below the functions on the `ExcelExportParams` interface to customise exported grid cell and row group values.\"}"},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following example shows Excel customisations where the exported document has the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"All row groups with the prefix "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"row group:"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"All cell values surrounded by "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"_"}]},{"type":"text","value":", unless they are "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"undefined"}]},{"type":"text","value":", in which case they are empty"}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{"className":["custom-block","note"]},"children":[{"type":"element","tagName":"div","properties":{"className":["custom-block-body"]},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Row group column cells are also cells. This means that each row group column cell will first have the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"processRowGroupCallback"}]},{"type":"text","value":" invoked for it, and then the returned value will have "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"processCellCallback"}]},{"type":"text","value":" invoked for it. This is why exported row group cell values will have the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"_"}]},{"type":"text","value":" surrounding the value, which is applied by the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"processCellCallback"}]},{"type":"text","value":"."}]}]}]},{"type":"element","tagName":"div","properties":{"className":["custom-block","note"]},"children":[{"type":"element","tagName":"div","properties":{"className":["custom-block-body"]},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When using row grouping while "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.5/grouping-multiple-group-columns/#hide-open-parents"},"children":[{"type":"text","value":"hiding open parents"}]},{"type":"text","value":" ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"groupHideOpenParents=true"}]},{"type":"text","value":"), export to Excel doesn't export the group rows as collapsible groups in Excel. Instead, all exported rows are on the same level and cannot be expanded/collapsed in Excel."}]}]}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Excel Export - Customising Row Groups","name":"excel-export-customising-row-groups","type":"generated","options":"{ \"enterprise\": true, \"modules\": [\"clientside\", \"rowgrouping\", \"csv\", \"excel\", \"menu\", \"setfilter\"]}"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"customising-column-headers-and-group-header-values","style":"position:relative;"},"children":[{"type":"text","value":"Customising Column Headers and Group Header Values"},{"type":"element","tagName":"a","properties":{"href":"#customising-column-headers-and-group-header-values","ariaLabel":"customising column headers and group header values permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The column headers and group headers exported to Excel can be customised using the following function params for a call to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"exportDataAsExcel"}]},{"type":"text","value":" API method or in the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"defaultExcelExportParams"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\n| gridApi.exportDataAsExcel({\n|     processGroupHeaderCallback(params) {\n|         return `group header: ${params.columnApi.getDisplayNameForColumnGroup(params.columnGroup, null)}`\n|     },\n|     processHeaderCallback(params) {\n|         return `header: ${params.columnApi.getDisplayNameForColumn(params.column, null)}`\n|     }\n| });\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"interface-documentation","properties":{"interfacename":"ExcelExportParams","names":"[\"processGroupHeaderCallback\", \"processHeaderCallback\"]","config":"{\"description\":\"See below the functions on the `ExcelExportParams` interface to customise exported column group headers and headers.\"}"},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following example shows Excel customisations where the exported document has the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Group headers with the prefix "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"group header:"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Headers with the prefix "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"header:"}]}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Excel Export - Customising Column Group Headers","name":"excel-export-customising-column-group-headers","type":"generated","options":"{ \"enterprise\": true, \"modules\": [\"clientside\", \"rowgrouping\", \"csv\", \"excel\", \"menu\", \"setfilter\"]}"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"next-up","style":"position:relative;"},"children":[{"type":"text","value":"Next Up"},{"type":"element","tagName":"a","properties":{"href":"#next-up","ariaLabel":"next up permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Continue to the next section: "},{"type":"element","tagName":"a","properties":{"href":"../excel-export-images/"},"children":[{"type":"text","value":"Images"}]},{"type":"text","value":"."}]}]},"frontmatter":{"title":"Excel Export - Customising Content","version":null,"enterprise":true,"sideMenu":null,"description":null},"headings":[{"id":"customising-cell-and-row-group-values","depth":2,"value":"Customising Cell and Row Group values"},{"id":"customising-column-headers-and-group-header-values","depth":2,"value":"Customising Column Headers and Group Header Values"},{"id":"next-up","depth":2,"value":"Next Up"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"react","srcPath":"/excel-export-customising-content","pageName":"excel-export-customising-content"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}