I’ve been trying to change the colour of several labels on a form (shown in print preview as a report) based on a column condition.
Works on the first record in the preview but is set the same for every record in the preview thereafter!
So record 1 Label A is set to red when Column Z is == 1, otherwise set to green. Works on record No 1, but all subsequent records have the same setting and do not change based on the column condition.
Is this a bug - or was it intended that a report could not display this functionality?
We can make this work in form view using the onRecord selection of course - but it really needs to be replicable in reporting too!
Robert Ivens has suggested a workaround (cheers Robert) using calculations and HTML as a return but that seems like overkill for basic functionality that might appear on ANY report - anyone else faced this one?
That event is only triggered once and subsequent records will use that same setting. Think of it as having a list view and you have record 1 selected. Subsequent records won’t have the onRecordSelection triggered when printing. In my understanding printing with recordview works in the same way.
So therefor my advice to use a (calculated) dataprovider that sets the background color in HTML and use that in a field. A simple bgcolor tag in the would suffice.
If you use this on several fields (with the same color criteria) then you could use 1 calc and show that field underneath the ones (that are made transparant) that need to be colored.
I get that thanks Robert - and thanks for the workaround. Isn’t it a bit tiresome though, to have to work around reports like this. Surely the report data should be analysed as the report is built and actions taken per row of the report (as it is in other technologies and dev environments)?
david:
This has always been the case when needing conditional formatting per row.
If you haven’t checked out the Velocity plugin yet for reporting, highly recommend over Servoy’s default reporting mechanics.
Thanks David - yes we are intending to cross over fully to Velocity when this version is out the door - too late for this one though.
We are using some of the Browser Suite for native dialogues etc and hope to use it more fully in the next version too.
I was just kinda’ hoping the Servoy Reporting set-up would be robust enough for these basic reports in the short term. So many workaround’s and aspects they cant achieve - its a shame more development wasn’t brought into them. I genuinely though the Servoy report would display at least the same functionality as the 13 years old Access we were using before hand - but not so sadly. I know velocity and Jasper are around but it would have been great to have been able to keep the basic stuff under one dev environment.