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;