Select rows and save data?
Select rows and save data?
sowa
Posts: 12Questions: 2Answers: 0
I've been looking through all the extensions and what you can do but I might have missed this one. Can I use the select extension to highlight specific rows and save to an excel or pdf? (just those selected)
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You can use the Buttons extension for this.
Kevin
I just want to save a selected few rows, not the entire table?
This example shows saving selected rows.
Kevin
how do I change it from print to say pdf? it's not working how I try it if it's possible
Please describe specifically what is not working with PDFs. Are you able to generate PDFs with all the data but not with selected rows?
Please post your code so we can see what you are doing.
Kevin
Right now I have
It's just the basic buttons that downloads the entire table as the selected button. I'm interested to see if I can select specific rows, click PDF or excel and have only those show in my downloaded pdf or excel
You would use the same
exportOptions
as shown in the example I mentioned earlier for PDF, Excel, etc.https://datatables.net/extensions/buttons/examples/print/select.html
Kevin
I know but I can't get it to work. I'm trying to add it to the above code and I just get errors
I tried it again today and it worked. thanks for the help
Actually one other thing. This method seems to only allow one button type. When I try to have excel and pdf it only allows one.
What are the errors?
Maybe you can post the code snippet of what you are trying to do. Or better create a test case showing the issue:
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I know this is wrong, it doesn't work. If I have just pdf it will work with pdf, or lke this it just shows excel. I've tried moving things around and trying different ways but I can't get multiple buttons. They don't all necessarily need to work with the selected, I'd like pdf and excel and maybe the other buttons could be more if needed. like copy, csv
You need to group each button separately, like this:
Thank you that works perfect