react-pivot icon indicating copy to clipboard operation
react-pivot copied to clipboard

Combination of compact & excludeSummaryFromExport props breaks CSV Export

Open Smoothsmith opened this issue 5 years ago • 0 comments

If you enable both of these props, then any rows that get compacted are treated as totals and get excluded from the CSV Export.

I can resolve it by making these changes in the library code (Did it directly in my node-modules for the moment): if(self.compact && numSubDimensions == 1) { subRow.includeInExport = true; } //Inside subRows.forEach before the row is pushed. https://github.com/davidguttman/node-dataframe/blob/27b1cc62255ac971d53f51f65670e6f072c2cc23/index.js#L106

Then I can check '|| row.includeInExport' prop on this line: https://github.com/davidguttman/react-pivot/blob/7ff565efa813742c7d386b6643af02429a434a94/index.jsx#L276

But this requires 2 custom forks and feels messy.

(Apologies if I should just be doing a pull request or similar, I'm not quite sure of the right approach, and there's likely more elegant ways to make the same fix, so I thought I'd raise an issue instead).

Smoothsmith avatar Feb 06 '20 14:02 Smoothsmith