Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Printing a Form

Questions related to using nuBuilder Forte.
Post Reply
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Printing a Form

Unread post 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.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Printing a Form

Unread post 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
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Printing a Form

Unread post 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);
}
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Printing a Form

Unread post by Timo »

Many thanks - work great :D
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Printing a Form

Unread post by admin »

.
benritter
Posts: 49
Joined: Wed Aug 26, 2020 10:38 pm

Re: Printing a Form

Unread post 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
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Printing a Form

Unread post by kev1n »

Ben,

Wouldn't it be easier to create a report?
Post Reply