• Resolved adsmar87

    (@adsmar87)


    Hi, I am developing a table that uses the DataTables Buttons extension. Is it possible for the viewer to enter a custom title to appear at the top of the PDF export? e.g. display a text field next to the PDF button for them to enter a page title for the document which is inserted on to the exported file.

    Also, can today’s date be inserted into the PDF?

    Thanks, Adam

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean, but unfortunately, I’m not aware of an easy or directly usable solution for this, sorry. You would have to manually develop a custom solution here that then maybe uses the API functions of the external DataTables JavaScript library.

    Regards,
    Tobias

    Thread Starter adsmar87

    (@adsmar87)

    No problem, thank you for getting back to me so quickly. I suspected there would be no direct solution for custom page titles for each user.

    Regarding adding today’s date to the PDF, is this also not possible?

    Ad

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no, sorry, it’s the same for the date.
    The only suggestion here would be integrate the date into the table, maybe in the last row. You could use a plugin that can print the date via a Shortcode for this.

    Regards,
    Tobias

    Thread Starter adsmar87

    (@adsmar87)

    No problem. Great, thanks for your suggestion and help.

    Thread Starter adsmar87

    (@adsmar87)

    Hi, I have tried something similar your suggestion by adding a shortcode to the last row and making it a footer row. This displays on screen as I want, but the footer row does not appear in the PDF export.

    Because of the filters I want to use, the date shortcode can’t be a ‘normal’ row. How can I include the footer row in the PDF?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    the footer row is not in the PDF? That’s odd. I’m not sure why that would be the case… Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    to add on: It looks like there’s a setting that we can use in a “Custom Command” to turn showing the footer on: https://datatables.net/extensions/buttons/examples/html5/footer.html
    If you could post the full Shortcode that you are using, I can find that “Custom Command”.

    Regards,
    Tobias

    Thread Starter adsmar87

    (@adsmar87)

    Hi, I’m using the below shortcode.

    [table id=1 datatables_buttons=”pdf” datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns=2,3 /]

    I’m also already using the custom command “dom”: “BWlfrtip” to allow the filter and buttons extensions to show at the same time.

    Link: http://lmsportal.wpengine.com/table/

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ok, thanks! Then, please extend the “Custom Command” to

    "dom": "BWlfrtip", "buttons":[ { "extend": "pdf", "footer": true } ]
    

    Regards,
    Tobias

    Thread Starter adsmar87

    (@adsmar87)

    That did it. You’re a wizard Tobias!

    Thanks

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Custom title for PDF Button’ is closed to new replies.