Page 1 of 1

Fix for formatting in "print table"

Posted: Sun Jan 09, 2022 12:38 pm
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