FW: [PEAR] FormBuilder with SDG export
| From: | Prue | Date: | Tue, 22 Nov 2005 12:11:02 +0000 |
| Subject: | FW: [PEAR] FormBuilder with SDG export | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22056@lists.php.net to get a copy of this message | ||
As I've had no response to the question below, and with Justin's help with
formatting dates in DataGrid (which render correctly in xls and pdf) and
studying the manual numerous times, I had a go at it myself with partial
success. The following returns the last club name for all records in the
dataset:
function linkclub_id($params) {
global $do;
$do->get($params['record']['clubsfin_id']);
$club = $do->getLink('club_id');
return $club->name;
}
$dg->addColumn(new Structures_DataGrid_Column('Club_id', 'club_id',
'club_id', array('width' => '11'),null,'linkclub_id()'));
Ironically, the returned 'club name' renders correctly in all formats, ie
html, xls and pdf.
How do I get the correct linked data for each record?
Prue
-----Original Message-----
From: Prue [mailto:prue@clipmagic.com.au]
Sent: Sunday, 20 November 2005 8:15 PM
To: pear-general@lists.php.net
Subject: [PEAR] FormBuilder with SDG export
Hello
SDG with FormBuilder integration set on works great when rendering to html.
However when rendering to xls or (thanks for Arnaud) to PDF via render to
Array, the link fields appear as they do in the originating table as an _id
number, not the linked table's descriptive data. Without resorting to
complex SQL queries, is it possible to have FB 'magically' make the links
work with alternative renderers too?
Cheers
Prue