Exporting to PDF doesn't work as expected

Exporting to PDF doesn't work as expected

ParimalParimal Posts: 17Questions: 1Answers: 0
edited September 2011 in TableTools
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
}
],

Replies

  • ParimalParimal Posts: 17Questions: 1Answers: 0
    i think its overlapping bacuase last column is set as "bVisible": false,
  • allanallan Posts: 61,821Questions: 1Answers: 10,126 Site admin
    Can you link us to an example please? One of the issues with the current library used for the PDF generation is that I don't have a massive amount of control over the columns - although having said that, I've never seen overlapping columns before!

    > 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
  • MrBaseball34MrBaseball34 Posts: 96Questions: 0Answers: 0
    What is exactly used for PDF export anyway? Am I correct in assuming it's the HTMLtoPDF functionality from TCPDF?
  • ParimalParimal Posts: 17Questions: 1Answers: 0
    i am showing only few columns into page but i would like to add more column during export to PDF (hidden columns).

    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)
  • ParimalParimal Posts: 17Questions: 1Answers: 0
    Hi

    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.
  • ParimalParimal Posts: 17Questions: 1Answers: 0
    Hi

    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"
  • ParimalParimal Posts: 17Questions: 1Answers: 0
    any can help?
  • crea2kcrea2k Posts: 14Questions: 0Answers: 0
    I too have the original problem posted too, if you hide columns, it seems to hide the data in the columns but leaves the table header text which then overlaps the on header text of the column which is now in its place, mine too works fine for csv.
This discussion has been closed.