Page 1 of 1

Printing a Form

Posted: Tue Mar 27, 2018 3:22 pm
by Timo
In the browse view there's a Print Button but in an edit form not. How can I make it appear there as well? And ideally, the breadcrumbs and action buttons shouldn't be printed.

Re: Printing a Form

Posted: Wed Mar 28, 2018 2:53 am
by admin
Timo,

The Print button creates an HTML page containing all the records in the current way the data it is filtered and sorted.

That HTML page can then be printed or imported into a spreadsheet.

If you want to print an Edit Page just hit print screen or some other utility to print the screen.

Steven

Re: Printing a Form

Posted: Wed Mar 28, 2018 10:25 am
by toms
Timo, this should do the job:

// add a Print Button to the Edit Form

Code: Select all

if (nuFormType() == 'edit') {
    nuAddActionButton('nuPrintEditForm', 'Print', 'custPrintEditForm();'); 
}
// hide some elements before calling the print dialog

Code: Select all

function custPrintEditForm() {

    function setElementsVisiblity(v) {
        $("#nuBreadcrumbHolder").css("visibility", v ? "visible" : "hidden");
        $("#nuTabHolder").css("visibility", v ? "visible" : "hidden");
        $(".nuActionButton").css("visibility", v ? "visible" : "hidden");
     }

    setElementsVisiblity(false);
    window.onafterprint = function (e) {
        $(window).off('mousemove', window.onafterprint);
           setElementsVisiblity(true);
    };

    window.print();

    setTimeout(function () {
        $(window).one('mousemove', window.onafterprint);
    }, 1);
}

Re: Printing a Form

Posted: Thu Mar 29, 2018 4:03 am
by Timo
Many thanks - work great :D

Re: Printing a Form

Posted: Fri Mar 30, 2018 12:59 am
by admin
.

Re: Printing a Form

Posted: Mon Dec 07, 2020 5:07 pm
by benritter
Hi, thanks for this solution to printing the edit form. Do you know if there's a way to print multiple records in the "edit form" format? Ideally I would like to be able to do a search in the browse form and then print a separate page for every record (row) returned.
-Ben

Re: Printing a Form

Posted: Fri Dec 11, 2020 9:13 am
by kev1n
Ben,

Wouldn't it be easier to create a report?