AW: Studio 8 - changing the text colour on a report

Rudolf Bargholz rudolf at bargholz.ch
Sat Oct 3 12:15:44 EDT 2020


Hi Randy,

I would interpret your code that you want to color ALL items in the report. Not all object types in a report will have the $textcolor property, just keep this in mind. As Mayada mentioned, the notation normally references one single object, so your code would be 

Calculate $root.$ireports.rbusinesslabelsfx.$objs.MyField.$textcolor.$assign as kRed

It does not matter if you use Calculate or $assign. Both have the same result.

If you want to change the report properties during runtime, make sure you do it BEFORE the field is supposed to draw. Your code cannot be in the $print method of that object. You could place the code in the $construct before calling "Print record", or in an objects $print, e.g. a positioning section, before the actual field is printed.

If you want to change all objects you could

Do $cinst.$objs.$sendall($ref.$textcolor.$assign(kRed))

Any object type that does not have the property available would just ignore the assign.

What might be easier to use though is to have all field styles. The field style would have a text color assigned to it, then before you print you could change the value of the styles $textcolor attribute, and then when you print the report all fields in the report would use the property from the style. You would not have to jump through hoops to reassign lots of properties of lots of fields during runtime, which would negatively affect performance, but just make a small temporary change to the styles affected, and this would then propagate through all objects using the style.

Hope this helps.

Regards

Rudolf Bargholz

-----Ursprüngliche Nachricht-----
Von: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Plum Hollow Software
Gesendet: Samstag, 3. Oktober 2020 16:25
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Betreff: Studio 8 - changing the text colour on a report 

Hi List,

I would like to have a colour picker when a user selects a report to print but to start I just want to assign a colour to a report.  My piece of notation doesn’t work below:

	Calculate $root.$ireports.rbusinesslabelsfx.$objs.$textcolor.$assign as kRed

Any suggestions?



Thanks,

Randy Wilson
Plum Hollow Software Inc.
plum_hollow at cogeco.ca
905-563-6516




_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


More information about the omnisdev-en mailing list