Closed mgsloan closed 7 years ago
@mgsloan could you post a sample xlsx file so I could check out what's going on?
Hey! Sorry for the silly example, was experimenting with duplicate header names
thanks, I'll take a look into it later today
Yep, it's a bug in parsing here - I was using wrong assumption. I'll try to find a good way around it.
14b6172 fixes this issue :
λ> import qualified Data.ByteString.Lazy as LB
λ> bs <- LB.readFile "/home/qrilka/download/Sloan_excel_dup.xlsx"
λ> _wsPivotTables . snd . head . _xlSheets $ toXlsx bs
[PivotTable {_pvtName = "PivotTable1", _pvtDataCaption = "Values", _pvtRowFields = [FieldPosition (PivotFieldName "dup2")], _pvtColumnFields = [FieldPosition (PivotFieldName "dup")], _pvtDataFields = [DataField {_dfField = PivotFieldName "cost", _dfName = "Sum of cost", _dfFunction = ConsolidateSum}], _pvtFields = [PivotFieldInfo {_pfiName = Just (PivotFieldName "dup"), _pfiOutline = True, _pfiSortType = FieldSortManual, _pfiHiddenItems = []},PivotFieldInfo {_pfiName = Just (PivotFieldName "dup2"), _pfiOutline = True, _pfiSortType = FieldSortManual, _pfiHiddenItems = []},PivotFieldInfo {_pfiName = Just (PivotFieldName "cost"), _pfiOutline = True, _pfiSortType = FieldSortManual, _pfiHiddenItems = []}], _pvtRowGrandTotals = True, _pvtColumnGrandTotals = True, _pvtOutline = True, _pvtOutlineData = True, _pvtLocation = CellRef {unCellRef = "D1:H6"}, _pvtSrcSheet = "Sheet1", _pvtSrcRef = CellRef {unCellRef = "A1:C4"}}]
please let me know if there will be any other issues with it. Thanks
Awesome, thanks for the quick fix!
I've tried exporting a pivot table from Excel 2016, and importing via this package. The cells in the pivot table do get imported. However, the pivot table configuration does not get properly imported. Instead, I get:
But the pivot table had a row field, a column field, and a value field.