Skip to content
New issue

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

feat(exports): add Excel auto-detect format by field types & formatters #848

Merged
merged 1 commit into from
Dec 18, 2022

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Dec 18, 2022

  • this new feature is especially useful with cell as numbers, which prior to this PR was exporting wasn't always exporting cell as numbers, this PR fixes this
  • note that Date fields will NOT be exported as Date format but rather text fields using MomentJS detected format, dealing with Dates in Excel is just too hard to deal with in code while it's easy enough for the user to convert text fields to dates afterward
  • Group Total will also be exported as numbers via custom format, for example: "Total: $"0.00##;"Total: "($0.00##) so the Total text will show in Excel but the value will actually be saved as a number
  • extends on previous PRs

- this new feature is especially useful with cell as numbers, which prior to this PR was exporting wasn't always exporting cell as numbers, this PR fixes this
- note that Date fields will NOT be exported as Date format but rather text fields using MomentJS detected format, dealing with Dates in Excel is just too hard to deal with in code while it's easy enough for the user to convert text fields to dates afterward
- Group Total will also be exported as numbers via custom format, for example: `"Total: $"0.00##;"Total: "($0.00##)` so the Total text will show in Excel but the value will actually be saved as a number
@codecov
Copy link

codecov bot commented Dec 18, 2022

Codecov Report

Merging #848 (53d7753) into master (0055f8a) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #848   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          240       240           
  Lines        16406     16493   +87     
  Branches      5785      5869   +84     
=========================================
+ Hits         16406     16493   +87     
Impacted Files Coverage Δ
packages/excel-export/src/interfaces/index.ts 100.00% <ø> (ø)
packages/common/src/constants.ts 100.00% <100.00%> (ø)
packages/common/src/formatters/decimalFormatter.ts 100.00% <100.00%> (ø)
...ommon/src/formatters/dollarColoredBoldFormatter.ts 100.00% <100.00%> (ø)
...es/common/src/formatters/dollarColoredFormatter.ts 100.00% <100.00%> (ø)
packages/common/src/formatters/dollarFormatter.ts 100.00% <100.00%> (ø)
...ckages/common/src/formatters/formatterUtilities.ts 100.00% <100.00%> (ø)
.../common/src/formatters/percentCompleteFormatter.ts 100.00% <100.00%> (ø)
packages/common/src/formatters/percentFormatter.ts 100.00% <100.00%> (ø)
...es/common/src/formatters/percentSymbolFormatter.ts 100.00% <100.00%> (ø)
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ghiscoding ghiscoding merged commit 27a18c4 into master Dec 18, 2022
@ghiscoding ghiscoding deleted the bugfix/excel-export-prefix-suffix branch December 18, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant