Welcome to the nuBuilder Forums!

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

Fix for formatting in "print table"

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Andrea
Posts: 29
Joined: Sun Jan 02, 2022 10:18 am
Been thanked: 1 time

Fix for formatting in "print table"

Unread post by Andrea »

Hi,

I noticed that field formatting was missing on the page created after click on print button in browse form ("print table").

The solution was line 70 of nurunhtml.php:

Code: Select all

$h	.= "<TD $st>" . $v . "</TD>\n";	
I replaced it by the following:

Code: Select all

$f = $c[$col]->format;	
$h	.= "<TD $st>" . nuAddFormatting($v, $f). "</TD>\n";
//	$h	.= "<TD $st>" . $v . "</TD>\n";	
Now output is formatted :-)

To make sure it works without error, the object on the edit form needs to have a suitable formatting,too.
If there are fields with text in it (entered on edit form) but output on browse form is formatted as a date or number format there are errors.
To prevent such errors one could add a check if the value is date or number before trying to format it.

Best wishes.

Andrea
Post Reply