Exporting to PDF doesn't work as expected
Exporting to PDF doesn't work as expected
Parimal
Posts: 17Questions: 1Answers: 0
Hi
I have following configuration into datatable.
Exporting to the PDF doesn't work properly, its overlapping column. Exporting to the EXL is ok and working as expected, but not for pdf.
Exporting PDF works fine with ( "mColumns": "visible" ) configuration.
Also how i can export all data as its exporting only current page data.
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "",
"sToolTip": "Save as XLS",
"mColumns": [ 0, 1, 2, 3, 4, 5, 7 ],
"bShowAll": true
},
{
"sExtends": "pdf",
"sButtonText": "",
"sToolTip": "Save as PDF",
"sPdfOrientation": "landscape",
"mColumns": [ 0, 1, 2, 3, 4, 5, 7 ],
"bShowAll": true
}
],
I have following configuration into datatable.
Exporting to the PDF doesn't work properly, its overlapping column. Exporting to the EXL is ok and working as expected, but not for pdf.
Exporting PDF works fine with ( "mColumns": "visible" ) configuration.
Also how i can export all data as its exporting only current page data.
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "",
"sToolTip": "Save as XLS",
"mColumns": [ 0, 1, 2, 3, 4, 5, 7 ],
"bShowAll": true
},
{
"sExtends": "pdf",
"sButtonText": "",
"sToolTip": "Save as PDF",
"sPdfOrientation": "landscape",
"mColumns": [ 0, 1, 2, 3, 4, 5, 7 ],
"bShowAll": true
}
],
This discussion has been closed.
Replies
> Also how i can export all data as its exporting only current page data.
I'm going to guess you are using server-side processing then. Since the client-side doesn't hold all of the data, it can't export it all. So there are two options - you can either use client-side processing for the DataTable, or you can have TableTools make a request to the server which will build the PDF for you (if you've got a lot of rows this is the better option, although obviously involves a little more work).
Allan
Also i have one more question, one column contains long data which increase the height of row so is there any way i can control the height of row (e.g. show only 2 rows into columns)
How i can convert json based result into excel file as part of export.
{
"mColumns": [0, 1, 2, 3, 4, 5, 6, 7],
"sExtends": "ajax",
"sAjaxUrl": ajaxHandlerURL
},
Wheren i click on ajax export button its calling to server and return with data but i don't know how its conver or save to excel.
how i can convert json based result to export as part to export functionality
"mColumns": [0, 1, 2, 3, 4, 5, 6, 7],
"sExtends": "download",
"sButtonText": "Save as Excel",
"sUrl": ajaxHandlerURL+"?Exporting=true"