-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
[WIP] Multi-row head export #55
Conversation
Thanks for sending the PR. There are a few gotcha's with multi-row headers and footers (colspan / rowspan just can't be supported in CSV for example) so I'm not going to pull this in immediately. I'll review closely and hopefully pull it in in the not to distant future. |
Hi, @DataTables This is just an outline. I will continue to completion. Best regards, |
Hi @Ladel! Thanks for solution, it was useful =) |
@DataTables I think for CSV usually rows of header isn't necessary .
|
Is there any plans to include multiple headers export feature in upcoming releases? |
Yes, but I'm not sure when. It isn't planned in the near future I'm afraid. |
Hi, @DataTables May I ask if this feature could be implemented? Thank you for answer. Good work! |
It hasn't yet I'm afraid. It is something I'm aware of needing to be done, but I want to change the framework of how it works in DataTables core first. |
Dear @DataTables I had a similar problem/issue, but since I was facing it within R implementation of https://github.com/DataTables/DataTables, I worked on a solution within R. I was told by @yihui and @shrektan that RStudio version actually imports the code automatically and they suggested that changes were to be made here. As I see this PR has been opened for quite some time, before I invest any time in translating my solution to here, I would like to know if there's interest in pursuing this at this level. If so, I'd open a new PR, I guess. Looking forward to hearing from you. |
Hi! So there are a number of things that need to be addressed as part of the work for multi-row header and footer export, some of which are not trivial unfortunately:
1 and 2 are actually at least in part addressed in the v2 branch of DataTables. So my intention is to finish exposing that information via the API and then have a branch of Buttons that supports those new features until DT2 alpha / beta is ready. The trick there is that I don't have a time scale for that yet as I'm working on a number of other things as well. |
Tks @DataTables for the quick reaction. Let me highlight a bit what my solution (within R) handles, so you can assess a bit better. First of all, I just want to highlight that my solution was aiming at complex headers, but not complex footers. Take this table as initial example (this is generated within a R Shiny application):
Indeed this was an issue. The initial solution sketched was missing the mark when colvis was active, or columns where programmatically hidden. This commit specifically handles that. From my example table above, regardless of the column visibility on screen, the full table is exported, unless specified by code by the programmer (which also works fine). Of course we could test it further to make sure I didn't miss any special case.
I'm not sure I know what you mean here. I have no problems with that. I didn't try extensively with hiding columns by code, but the few trials I had showed me no problem.
So far, copy, print, csv and pdf (i.e., everything except excel) handles in the same way, which is having "empty" columns for the spanned cols or rows. For example, the pdf export is: Excel export does merge the cells:
I don't see a problem here. See this base commit where the single-row header is replaced by a headerMatrix. Subsequently, the export functions for example here and here were updated to handle multi-row headers. In that sense, the single-row case becomes a special case.
See if my suggestions help here.
I'm very interested in having this feature mainstreamed. I think @yihui and @shrektan would also appreciated it. At the moment I'm using my own fork, but of course I'd prefer to use the main version. Therefore if you'd be open to me "translating" my solution to here, I can try to find the time to do so. |
The API is changing - The changes do look useful and it looks feature complete since you are using the internal aoHeader option. I'd like to see the same applied to the footer, but I could potentially add that if needed. |
I look forward to this feature |
Hi,
Status: WIP (work in process).
TODO:
Best regards,