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

Feature/complex headers and footers #170

Closed

Conversation

mtyszler
Copy link

These updates include a function that reads multi-row headers/footers into an array of arrays, where each array row is a header/footer row.

Further it updates csv, copy, pdf, excel and print to process the multi-row header/footer object. For Pdf, Excel and Print it merges the cells.

It supports colvis

It does not update the flash counterparts of html5 functions.

This page showcases the export with the original libraries.

This page showcases the export with the modified libraries.

(Source html at https://github.com/mtyszler/Buttons/tree/feature/complex_headers_and_footers/test/complex_headers_and_footers)

It changes:

  • dataTables.buttons.js
  • buttons.html5.js
  • buttons.print.js

which can be found at: https://github.com/mtyszler/Buttons/tree/feature/complex_headers_and_footers/js

See also #55
See also rstudio/DT#751
See also rstudio/DT#418
See also #60
See also #63
See also #123

…casing the problem with export complex headers and footers
… is applied, and the cellIndex are all negative
…excel export to handle complex headers and to merge cells.

Based on rstudio/DT@f7742c0 and rstudio/DT@6b56d58
…asing the problem with export complex headers and footers
@mtyszler
Copy link
Author

Dear @DataTables

Following our talk at #55, I cleaned-up the code and adjusted it so it fully handles both headers and footers.

I tested, but not stress tested fully, so you might check for problems you were aware, but all cases I was aware are working fine now.

I included two html file to show case the use of the modified tables.

Let me know,

@DataTables
Copy link
Collaborator

Thank you for this! I've raised it in our internal ticketing system (DD-1363) and will review it before the next version of Buttons goes out. I can't say exactly when that will be - there are a fair number of changes to make and we are working to various deadlines at the moment, but it will reviewed before the next patch.

@mtyszler
Copy link
Author

mtyszler commented Feb 1, 2020

Thank you for letting me know!

@Taufikismail
Copy link

Hi @mtyszler how to make header colspan text align center and background color when export to excel ?
Thank You

@mtyszler
Copy link
Author

Thank you for this! I've raised it in our internal ticketing system (DD-1363) and will review it before the next version of Buttons goes out. I can't say exactly when that will be - there are a fair number of changes to make and we are working to various deadlines at the moment, but it will reviewed before the next patch.

Hi @DataTables : is there any update on this? Sorry for bothering and thanks in advance :)

@DataTables
Copy link
Collaborator

No sorry. We haven't progressed this yet.

@DataTables
Copy link
Collaborator

Just been looking over this and it looks to be just about the perfect pull request - thank you!

I'm not going to pull it in just yet, because it changes the API a little - not much, but the header is now an array of arrays, a returned by buttons.exportData(). I know there are some out there who are using that method, so this would be a breaking change. I'd also like to extend your approach to work with the table footer as well.

I think this will be a Buttons v2 change due to that.

On the bright side, Buttons v2 is something I want to make happen in the not too distant future. It will include support for server-side processing on export (using a server-side document generator) and we can make breaking changes like this and dropping the Flash buttons.

@mtyszler
Copy link
Author

Thanks for the update, @DataTables . I did handled footers as well, but I understand you reluctance. I thought the "regular" workflow was unaffected, but I understand that if someone is specifically modifying/using the API, this might be an issue.

@AllanJard
Copy link
Contributor

Added now with the new structure methods for the header and footer that will be in DataTables 2. This will be part of Buttons 3 which will drop alongside DT2.

@AllanJard AllanJard closed this Oct 17, 2023
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.

4 participants