Export into excel with values repeated in groups

Answered
Nathanael Schmied asked on October 14, 2022

Hello,
We have customers wanting to export pivot table to excel to be able to play with the data.
The group identation of the export does not allow this in the standard. The wish is to repeat the groups values for each row and to have each value in its specific column.
It is certainly more clear in the attached screenshot.
Thanks a lot for your answer

Attachments:
flexmonster_dd.png

3 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 14, 2022

Hello, Nathanael!
 
Thank you for contacting us.
 
Kindly note that by design, the data in Flexmonster is exported in the same form it is visualized on the grid.
 
So, to achieve the desired exporting behavior, we firstly need to visualize the data on the pivot in the way you show in the screenshot.
 
The idea lies in the following:
 
1. Use the classic grid form instead of the compact. In the classic form, there is a separate column for every hierarchy from the rows, as in your screenshot. 
The grid type can be changed from the Toolbar by clicking on the Options tab or by setting the grid type to classic in the report as follows:

report: {
...
options: {
       grid: {
         type: "classic"
       }
  }
}

 
2. The default classic grid does not repeat the member name for all the nested members. You can fill the empty cells with the member's name by using the customizeCell() function as follows:

function customizeCellFunction(cell, data) {
  if (data && data.type == "header" &&  data.member &&  data.member.caption != 'All' &&  data.label == "") {
    cell.text = data.member.caption;
  }
}

 
You can read more about customizeCell() API call in our docs: https://www.flexmonster.com/api/customizecell/.
 
We have prepared a JSFiddle sample for visualization: https://jsfiddle.net/flexmonster/3m87wf9t/.
Please, export the grid to Excel and look through the exporting result.
 
 
Hope you will find our answer helpful.
 
Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 25, 2022

Hello, Nathanael!

Hope you are doing well.

Our team is wondering if you had some time to try the suggested styling approach. Could you please let us know if it works for your case?

Looking forward to hearing from you.

Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 1, 2022

Hello, Nathanael!

Hope you are having a great week.

Just checking in to ask if the suggested styling approach works for your case.

Looking forward to your response.

Regards,
Solomiia

Please login or Register to Submit Answer