I would like to be able to create a custom caption based on an SQL Query, such as “Select MAX DATE from Table”, then put that date in the caption. I have a few reports that are built on static-data, so it would be nice to know the most recent date from the report for the caption.
I have tried a few different tricks, but nothing works and I don’t see anything in the Demos or on the help-site.
Any thoughts would be appreciated.
Thanks
Mike
Ticket can be closed – I was not setting the variables correctly, this works perfectly fine if you run an ODBC_EXEC, then fetch the array and set the variable.
Thanks
Mike
Thanks for updating.
You can run a query to get your value from database. Here $g is jqgrid object.
$rs = $g->get_one(“SELECT field from tab limit 1”);
$cap = $rs[“field”];
$opt[“caption”] = $cap;
does not seems to work, print_r($rs); there is nothing in rs varible.. $rs = $g->get_one(\”SELECT updated from markup limit 1\”); $cap = $rs[\”updated\”];
Please share complete code for review. You can paste code on gist and share link here.
https://gist.github.com/