RE: [PEAR] DataObject, DataGrid and joins
| From: | Prue | Date: | Fri, 18 Nov 2005 09:56:24 +0000 |
| Subject: | RE: [PEAR] DataObject, DataGrid and joins | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21982@lists.php.net to get a copy of this message | ||
Hello Olivier
Thanks for your reply. I did try to get the CVS version but couldn't and
then had to move onto other things. For what it's worth, here is some more
feedback:
1. Under NO circumstances could I get joinAdd to work with DataObjects even
before getting to the SDG issues.
2. Using $sql = 'SELECT table1.fieldname1, table1.fieldname2,
table2.fieldname1,
FROM table1, table2
WHERE table1.fieldname1_id = table2.fieldname1_id';
$obj->query($sql);
$obj->get();
worked
3. If I used $dg->renderer->setFilename('datagrid.xls',false);
The correct Excel spreadsheet was created and saved to disk.
4. If I used $dg->renderer->setFilename('datagrid.xls');
Two spreadsheets were created. One named datagrid.xls contained
only the column headings and was immediately displayed on the screen. The
other, named datagridxx.xls contained the correct data, where 'xx' was the
next incremental number of copies of the spreadsheet that had been
generated. This was automatically downloaded to the local machine.
Hoping either my unofficial QC makes for a better product or someone can
tell me what I'm doing wrong,
Prue
PS: Has anyone devised a way to 'pretty-up' the format of the output Excel
worksheet?
-----Original Message-----
From: Olivier Guilyardi [mailto:ojaiml@nerim.net]
Sent: Thursday, 17 November 2005 3:40 AM
To: prue@clipmagic.com.au
Cc: pear-general@lists.php.net
Subject: Re: [PEAR] DataObject, DataGrid and joins
Hi,
Prue wrote:
> Please help. I've tried all sorts of combinations and the results
> just get weirder. Firstly, if I create the DG with only one DO, it
> produces the correct output. As soon as I attempt to join another
> table, the only things output are the column headings. Please advise
> if I've used the wrong syntax to call the fields
>
> Next, with "$dg->renderer->setFilename(datagrid.xls');" two Excel
> spreadsheets are created. If I use
> "$dg->renderer->setFilename(datagrid.xls',false);" as recommended in
> the Changelog for 0.6.3 then no spreadsheets are created. Both
> behaviours are repeatable.
>
> At one point, when using "$dg->renderer->setFilename(datagrid.xls');"
> two DIFFERENT spreadsheets were created. One was as per the defined
> columns and another with the same columns PLUS the name of one of the
'joined' tables
> and an extra linked id field from the DO that called the join?????? This
> also was repeatable until I rebooted the PC.
>
> Please advise how to fix.
> The SDG version is 0.6.3 and my code is:
Can you try this with the latest CVS ?
You can check it out with :
$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
(use "phpfi" as password)
$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pear/Structures_DataGrid
--
og
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php