PDF export
-
Hello
I wish to have so i can see the pdf in landscape mode for i have many columns. And also if you have a place there i can see many options how to config the pdf layout.
Regards
Icemanmx
-
Hi @icemanmx,
You can adjust the orientation of your PDF export by adjusting your PDF button options via the Advanced Settings | WP Data Access.
The option you need is outlined here: DataTables example – PDF – page size and orientation
Hope that helps! Let us know if you have more questions.
Hello
I added the code but gives me a error as Parse error on line one?
$(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', buttons: [ { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'LEGAL' } ] } ); } );
So how do i format it for wpad ?
Regards
Hi @icemanmx,
The options you add in your table’s Advanced Settings need to be valid JSON.
Please try the following:
{ "dom": "Bfrtip", "buttons": [ { "extend": "pdfHtml5", "orientation": "landscape", "pageSize": "LEGAL" } ] }
Let us know if that works. ??
Hello
No, it does not work, that you see on the picture i got in my mail, but i also tried the one from the forum and get parse error…
Regards
Hi @icemanmx,
You have random characters after the word “buttons”.
Please copy the code I posted above fully.
Please see here: https://share.getcloudapp.com/jkuR8qA0
Hope that helps.
If you was reading my post, i said that i used both, that one what was coming in the mail and also that one one you posted here on the forum, non of does two worked…
Regards
Hi @icemanmx,
Please see here: https://share.getcloudapp.com/RBuJk7ky
I hope this is more clear.
Let us know if you still see issues.
Yes i know, i tried both scripts you gave me, and non is function…
Regards
Hello
{ "dom": "Bfrtip", "buttons": [ { "extend": "pdfHtml5", "orientation": "landscape", "pageSize": "LEGAL" } ] }
This script does not work, ok it works but no buttons shows more then the PDF button. Also to be able to mark one row and only show that row do not work, so it is not good script, it is missing something. So i must ask, you guys have support for this or not? If not i will search for other plugins for this, for me is that the PDF will work 100%, and you guys are the one who build this plugin.
Regards
Hi @icemanmx,
Since you have modified the pdf button using the Advanced Options, you’ll have to add the other buttons manually. If you want to show the other buttons, you can add them manually like the following:
{ "dom": "Bfrtip", "buttons": [ "copy", "csv", "print", "excel",{ "extend": "pdfHtml5", "orientation": "landscape", "pageSize": "LEGAL" } ], "select": { "selector": "td:not(.dtr-control)", "style": "multi" } }
To only print / show the rows you selected, the option “select” must be added, which I added on the code above.
For more reference, please see: Export to PDF, CSV, Excel, SQL | WP Data Access
Hope that helps. Let us know if you have more questions.
Hello, thanks, that works, now i only need to style it a bit, make fonts smaller and center it…. you have somewhere where i can look at that?
Regards
Hi @icemanmx,
You can modify the style of your table elements using CSS. You can send us a link to your table so we can help you with the correct selectors.
Hello
The problem is that i have many columns, i wish to make it smaller with smaller font, and also just show the first 8 headers columns. After that 8 the rest should come under each other, now i don′t know if that can be made!! Also, when saving the excel or pdf if i can get it to save with the name of the Folio in column 2 only of course if you save it one by one with marking the column. https://factura.icemanmx.com/ib-odt-orden/ if you open one with the green plus sign, then you see how many they are.. And also, if the cells are empty don′t export them… that my wishes if it can be done…
Regards
Hi @icemanmx ,
Can you please try adding this CSS code?
.wpda_publication_container table{ font-size: 11px !important; }
This will adjust the font size of your table including the header and table data. Feel free to change how many pixels suit your preferrence.
Let us know how it goes for you.
That function good, now just to get the PDF fixed also…
https://factura.icemanmx.com/ib-odt-orden/
Regards
- The topic ‘PDF export’ is closed to new replies.