Export child rows using excelHTML5
Export child rows using excelHTML5
Khushi2005
Posts: 6Questions: 2Answers: 0
Hi,
I was succefully able to add Child Rows using this link
https://datatables.net/blog/2014-10-02
I have added a nested table and would like to export all the new added children using Export function
What I noticed is formatted child rows do not get Exported.
How do we export child rows?
Thanks in advance.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
According to Allan exporting child rows is not available:
https://datatables.net/forums/discussion/comment/103982/#Comment_103982
Kevin
Oh..
So what is the best way to export the data?
Exporting nested data to Excel may not make sense but how about Print Preview or Copying the contents?
A quick forum search finds this (for example):
https://datatables.net//forums/discussion/43133
One question on Child Rows. Can we add events to Child Rows along with adding Child to Child Rows?
I am trying to created Nested table scenario. More like Drill Down Reports.
Thanks in advance
I'm afraid I don't really understand what you mean. Do you want to trigger an event when the child row is created? If so, DataTables itself doesn't currently trigger such an event, but there is no reason why you couldn't do so using
$.trigger()
.Allan
Hi,
We managed to export the Child Rows by modifying the script "exportTableToCSV"
First we will change the natural function of the button xls and csv
Then we create the functions that creates the files and the one that downloads them:
```
```
With this method you can export the child rows of many Datatables:
English provided by Google
Brilliant! Thanks for sharing your code with us.
Allan
is there a way to use this function to export nested rows in pdf
The PDF export is entirely different from the Excel export I'm afraid (since they use different document definition formats). To have this working with the PDF export it would need to be rewritten for the pdfmake library.
Allan
allan
if u can do this i will be really thankful to your.
Regards
Child row export is not currently something I'm working on I'm afraid. It is something we hope to introduce longer term, but there are other things we are working on at the moment.
Allan
@allan
Hi I have used your code to export child row in CSV and EXCEL and I can say it is very optimized code and apart from this I want to do the same in the case of Pdf and Print so can you please provide the code for that also it will be very thankful to you.
Anyone knows about this please tell me.
Thank you
Santosh Chaurasiya (onhand.us)
Hi,
I'm afraid exporting of child rows is not something that Buttons currently supports as I note above.
Allan
Any updates on this subject?
The answer is already here... Thanks @AndreNeves !
@AndreNeves Thanks for your answer. But that export only current page data. Have to export all data. Kindly Help me out ASAP
@Gurupriyan Are you using server side processing? If so then this FAQ will answer your question:
https://datatables.net/faqs/index#buttons
If not then please post more information about what you have. A link to your page or a test case would help greatly to see what you have and help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
@AndreNeves Can we create table inside table and have common column search for both tables or common excel, pdf and copy options.
The child detail rows are independent of the row data and won't share common search or export functions. If the data is part of the row data you can place them in hidden columns using
columns.visible
then the would be searchable and exportable. If the data is not part of the row data then you will need to create custom functions for each.Kevin
guys, this is really simple.
just include the child data but hide the coloum and it will print
@kuz1toro If you're able to provide an example/fiddle, that would help explain that.
Thanks,
Colin
A bit late but it tried kuz1toro exemple like this :
Here my fieds 'Teinte' and 'ton' are hidden by default but printed in the excel export.
Then my detail control can just duplicate the content like this: