Re: FW: [PEAR] FormBuilder with SDG export

From: Date: Wed, 23 Nov 2005 17:53:05 +0000
Subject: Re: FW: [PEAR] FormBuilder with SDG export
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22066@lists.php.net to get a copy of this message
On 11/22/05, Prue <prue@clipmagic.com.au> wrote: > Oh dear, apologies all round (again). I'd stared at the problem for too > long. > The bug as expected was in my code. There was no $options in the > $dg->bind($do) statement for the alternate renderers. I'd stayed out of the conversation to this point because I wasn't sure how this could be happening since the DO DataSource is the thing doing the FB integration (I know, I wrote that part ;-). Glad you found your problem. > > > -----Original Message----- > From: Prue [mailto:prue@clipmagic.com.au] > Sent: Wednesday, 23 November 2005 8:02 AM > To: 'pear-general@lists.php.net' > Subject: RE: FW: [PEAR] FormBuilder with SDG export > > > > > What I want to achieve is that regardless of the renderer, the link > > field from the originating DO outputs the nominated data from the > > linked DO for each record. > > > If you get different results with different renderers, then there is > > either a problem in the way you use the renderers (how do you choose > > which one is used?) or there is really a bug in the renderers. > > When you navigate to the page, the HTML render is used. There are two > 'mini' forms on the page, each with only a submit button - one named xls and > the other pdf. In the script: > > // Create a new SDG object > if (isset($_POST['xls'])){ > $dg =& new Structures_DataGrid(null, null, DATAGRID_RENDER_XLS); } else > { > $dg =& new Structures_DataGrid($page); > } > [... other stuff ..] > > if (isset($_POST['xls'])){ > $dg->bind($do); > $renderer =& $dg->getRenderer(); > $dg->renderer->setFilename('datagrid.xls'); > $dg->render(); > return; > } else > if (isset($_POST['pdf'])){ > require_once ('include/classes/pdf/class.ezpdf.php'); > $dg->setRenderer("Array"); > $dg->bind($do); > $data = $dg->renderer->toArray(); > $pdf =& new Cezpdf(); > $pdf->selectFont('include/classes/pdf/fonts/Helvetica.afm'); > $pdf->ezTable($data[Data]); > $pdf->ezStream(); > return; > > } else { > $dg->bind($do, $options); > $renderer =& $dg->getRenderer(); > $dg->renderer->toHtml(); > return; > } > > That all seems to work fine. > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.general (#22066) next »