-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGridPremium] Add excel export #3802
Conversation
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great starting point!
@@ -181,6 +181,7 @@ | |||
] | |||
}, | |||
"dependencies": { | |||
"exceljs": "^4.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense for direct dependencies to be locked with ~
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an opinion on this subject. I had a look at core repo, all the dependencies are with ^
|
||
const excelJS = await getExcelJs(); | ||
const workbook: Excel.Workbook = new excelJS.Workbook(); | ||
const worksheet = workbook.addWorksheet('Sheet1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we allow the name of the sheet to be passed as an input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but as long as we use only one sheet per workbook, I don't see the interest
const { columns, rowIds, getCellParams, includeHeaders } = options; | ||
|
||
const columnsWithoutCheckbox = columns.filter( | ||
(column) => column.field !== GRID_CHECKBOX_SELECTION_COL_DEF.field, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can remove the checkbox
column when the columns are being organized, in the useExcelExport
hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it makes sense. I also moved this filter from csvSerializer to useCSVExport to have a utils
used by both the CSV and the Excel
packages/grid/_modules_/grid/hooks/features/export/serializers/excelSerializer.ts
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/export/serializers/excelSerializer.ts
Show resolved
Hide resolved
08f1bdc
to
f12d3ef
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
👋 The migration PR has been merged. Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)
If you are struggle with the steps above, feel free to tag @siriwatknp |
The modification of the file structure implies too much conflicts. I started another branch #3981 |
Depends on #3806
TODO
preview