php-reports icon indicating copy to clipboard operation
php-reports copied to clipboard

Select Variable value

Open abbasmavin opened this issue 10 years ago • 2 comments

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.

abbasmavin avatar Sep 20 '14 19:09 abbasmavin

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.

blades avatar Jun 03 '15 21:06 blades

Solution is simple, without any code update. See below example

options: [{display:"ok", value:"1"},{display:"anulowany", value:"3"}]

jbienko1 avatar Jun 17 '15 20:06 jbienko1