Export PDF Custom

Export PDF Custom

Massimo74Massimo74 Posts: 85Questions: 1Answers: 0

sorry I have this export that works well, but I would like to fix the graphics for example ... 1st I would like the table to occupy the whole sheet and not just a part. 2nd the salary column I would like to align to the right, so do you like recommended? Here

Replies

  • Massimo74Massimo74 Posts: 85Questions: 1Answers: 0
    edited July 2019

    Here in column "Extn" "Export-pdf" >>>return '<span style="color:' + color + '" class="pull-right" style="text-align:right">'+(data)+' €</span>';
    NOT WORK
    on display is GOOD

  • Massimo74Massimo74 Posts: 85Questions: 1Answers: 0

    I HAVE FOUND THE SOLUTION, BUT I HAVE A PROBLEM WITH THE COLUMNS WHEN I MAKE THEM INVISIBLE, THEY COUNTING THE COLUMNS IN THE SHEET CANNOT REFER TO THE COLUMN TARGETS or the type of data in the column (text or numeric)
    because in this way he checks the exported columns
    HERE

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @Massimo74 ,

    I'm not clear what the problem is. If it's only visible rows are exported, it's because you have this,

                        exportOptions:{
                          columns:':visible:not(.not-export-col)',
                          orthogonal: "Export-pdf"
                        },
    

    which is saying only export visible rows.

    If not, can you give steps to reproduce, please.

    Cheers,

    Colin

  • Massimo74Massimo74 Posts: 85Questions: 1Answers: 0

    Here
    The step by step problem:
    Step 1 put all visible columns and export pdf ... (in the pdf file the "salary" column is aligned to the right (OK) (doc.content [1] .table.body [i] [5] .alignment = 'right';).
    Step 2 ° now hide the "salary" column and launch export pdf ... in the console (Cannot set property 'alignment' of undefined)
    NB:since I never know which columns are exported, how can I define the alignments in the export?

  • allanallan Posts: 61,609Questions: 1Answers: 10,089 Site admin

    doc.content [1] .table.body [i].length will give you the number of exported columns. You can adjust your code based on that (length-1 to get the last column for example).

    Allan

  • Massimo74Massimo74 Posts: 85Questions: 1Answers: 0

    ok I should have solved it like this ... I leave it if it's for someone
    Here

This discussion has been closed.