We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Codec.Xlsx.Formatted.formatWorkbook, it seems that the merge information is accumulating as new worksheets are added.
Codec.Xlsx.Formatted.formatWorkbook
In the below example:
fcm1
(1,1)
colspan
2
fcm2
(20,1)
let xlsx = XF.formatWorkbook [("Sheet 1", fcm1), ("Sheet 2", fcm2)] X.minimalStyleSheet
Looking in the output, however, Sheet 2 has merged cells for both (1,1) (leaking from first sheet's data) and (20,1) (as expected):
Sheet 2
and
... because Xlsx has following merge information:
Xlsx
Xlsx {_xlSheets = [("Sheet 1", Worksheet {_wsColumnsProperties = [], -- TRUNCATED _wsMerges = [CellRef {unCellRef = "A1:B1"}], -- TRUNCATED ("Sheet 2", Worksheet {_wsColumnsProperties = [], -- TRUNCATED _wsMerges = [CellRef {unCellRef = "A1:B1"}, CellRef {unCellRef = "A20:B20"}], -- TRUNCATED
The suspect seems to be the stateFromStyleSheet that keeps accumulating merge information regardless of related worksheet.
stateFromStyleSheet
Do we really need to keep merge information as a global state variable? Or could we associate merge information with the worksheet?
Or am I getting it all wrong?
Edit: It is formatCell that updates the global merge information as it does not know anything about the worksheet?
formatCell
The text was updated successfully, but these errors were encountered:
Issued a PR (#143) that works for me.
In summary, it resets merge information in formatWorkbook when starting to process new worksheet data.
formatWorkbook
Sorry, something went wrong.
chore(test): add test for debugging issues on merged cells
9748463
See qrilka/xlsx#142
chore: use forked xlsx (vst/xlsx) that fixed merge info issue
4cf3bf5
Successfully merging a pull request may close this issue.
When using
Codec.Xlsx.Formatted.formatWorkbook
, it seems that the merge information is accumulating as new worksheets are added.In the below example:
fcm1
has a formatted cell at(1,1)
withcolspan
being2
, andfcm2
has a formatted cell at(20,1)
withcolspan
being2
.Looking in the output, however,
Sheet 2
has merged cells for both(1,1)
(leaking from first sheet's data) and(20,1)
(as expected):and
... because
Xlsx
has following merge information:The suspect seems to be the
stateFromStyleSheet
that keeps accumulating merge information regardless of related worksheet.Do we really need to keep merge information as a global state variable? Or could we associate merge information with the worksheet?
Or am I getting it all wrong?
Edit: It is
formatCell
that updates the global merge information as it does not know anything about the worksheet?The text was updated successfully, but these errors were encountered: