WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Printing from the web page (8 posts)

  1. Arachneworks
    Member
    Posted 1 year ago #

    Hi Tobias,
    I am testing your great plugin for use by students, viewing their assignments. What would be the best way to provide an option for the students to print only the assignments, to local printer, directly from the web page, possibly allowing for custom styling?
    Thanks for your support.
    Regards, Tony
    http://arachne.co.za/nla/gr12-designp2-november-2012/

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tony,

    thanks for your question.

    For this, I recommend to use the "DataTables TableTools Extension" for TablePress, which you can get at http://tablepress.org/extensions/datatables-tabletools/
    This will add a "Print" button above your table, which will then allow to just print the table, without the other stuff on the page.

    Regards,
    Tobias

  3. Arachneworks
    Member
    Posted 1 year ago #

    Thanks Tobias,
    I have installed datatables-tabletools/. I am not sure what steps to take to get the print option to show? I presume "Initialisation code" has to be included, I am not sure how to do this. Please help with some more direction?
    Regards,
    Tony

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tony,

    ok, you've done the first step, i.e. installing and activating the Extension.
    Now, please extend your table's Shortcode on the page from

    [table id=6 /]

    to

    [table id=6 datatables_tabletools=true /]

    Additionally, please go to the "Edit" screen of table 6, and check the "Use DataTables" checkbox. That is required for the Extension to work. You will then initially also see the sorting, filtering, and pagination features activated, so just uncheck the checkboxes for these individual features (below the "Use DataTables" checkbox).

    Regards,
    Tobias

  5. Arachneworks
    Member
    Posted 1 year ago #

    Thanks Tobias,
    I have got the options displaying, it is just to limit the options to print only that I am not sure about.
    Regards,
    Tony

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tony,

    ah, ok.

    For that, you'll need to modify the source file, of the Extension. Please edit the file "tablepress-datatables-tabletools.php" like this:
    Replace line 60

    $tabletools_options = '{ "sSwfPath": "' . $swf_path . '", "aButtons": [ { "sExtends": "copy", "sButtonText": "" }, { "sExtends": "csv", "sButtonText": "" }, { "sExtends": "xls", "sButtonText": "" }, { "sExtends": "pdf", "sButtonText": "" }, { "sExtends": "print", "sButtonText": "" } ] }';

    with

    $tabletools_options = '{ "sSwfPath": "' . $swf_path . '", "aButtons": [ { "sExtends": "print", "sButtonText": "" } ] }';

    After that, you'll only have the "Print" button.

    Regards,
    Tobias

  7. Arachneworks
    Member
    Posted 1 year ago #

    Hi Tobias,
    I understand, many thanks. I am developing at this stage, hopefully can reward once I have buy-in.
    All the best,
    Tony

  8. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tony,

    sure, no problem! You are very welcome!

    Best wishes,
    Tobias

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic