jdorn / php-reports

A PHP framework for displaying reports from any data source, including SQL and MongoDB
http://jdorn.github.com/php-reports
GNU Lesser General Public License v3.0
477 stars 235 forks source link

Dynamic variable options in PHP reports? #218

Open rick-cti opened 8 years ago

rick-cti commented 8 years ago

For MySQL reports, it's possible to use database_options to bring in dynamic options for a select variable. With PHP reports, it seems only the options property is available, and these options can't be dynamically generated by the PHP code as the report headers must appear at the top of the file.

Is it possible to dynamically generate variable options within the PHP report itself?

Many thanks.

nwgarner commented 8 years ago

I have this question as well. It's been asked on the Forum over here a couple times but is unanswered. I posted again there.

davidmichaelakers commented 8 years ago

I've created a dynamic header that will allow you to do what you want. Put it in your classes/local/header and you should be good. See the patch above for examples on how to use.

haglerw commented 6 years ago

Hi rick-cti,

The framework won't display options for another table for select. I'm using mysql, how did you manage to do that? It's really giving me headache.

haglerw commented 6 years ago

I just found what's been the issue, I did not have a closing }, thanks.