Use a different SELECT statement for Export.
In most grids I use setcoledittype() to show values for underlying ids. When exported, only the id's are shown, not the values.
For instance, my SELECT statement would be:
"SELECT purchaseid, customerid, articleid, amount FROM purchases"
using edittype i would set customerid to view the customer name and articleid to view the article name.
Only when exported, the id's are exported, but the names are not.
It would be nice to have an option something like this:
$dg->setexportsql("SELECT purchaseid, customername, articlename, amount FROM purchases LEFT JOIN customers USING(customerid) LEFT JOIN articles USING(articleid)");
-
dknisley commented
Was this functionality ever added?
-
Stephen Welch commented
Just bought phpgrid and this one one of the first issues I came across - very annoying.
To be honest it would be good to have the export as an option to export RAW data (as it does now) or export as displayed.
My users would like "reports" showing actual words - not id's.
But for database table issues etc to be able to export the raw data - as it does now - is great.Having already setup how we would like our columns displayed the export option could be enhanced to something like
enable_export('EXCEL',RAW') ; # data as exported currently
enable_export('EXCEL',DISPLAY) ; # data as the user sees it on their screen