php-reports
php-reports copied to clipboard
Select Variable value
Hi, First, thanks a lot for this simple-yet-amazing effort! I've been trying to use this as Reporting module for my application. One thing I wish I could do is to be able to use different values and labels for select type variable. As of now, even if I define options attribute as an array of key-value pairs, it always uses values for select object's value and label. Probably I'm missing something here. But I couldn't figure it out.
i'm having exactly the same problem myself, so i don't think it's just you.
in fact, i think it's a bug in the Report.php class line 336. If you change it to:
'display'=>$key,
then it seems to work.
the only downside i've found so far is that the value still shows up in the variables-holder span when the report runs instead of the chosen name.
Solution is simple, without any code update. See below example
options: [{display:"ok", value:"1"},{display:"anulowany", value:"3"}]