Think a page of mailing labels. I can change the color of some text within a single label by having 2 different TextDisplayObjects. One TDO is set to display a field of data if ‘desired color’ field contains some special character. The other TextDisplayObject displays if ‘desired color’ field has a different character within it. The result is that each label will have text color based on the contents of a ‘desired color’ field. Within that page of labels, some have green text, others have black text. Kludgy but it works.
I now want to change the color of a RectangleShapeObject on a label by label basis.
What would be the proper or best way to change the color of a rectangle per record?
A much less kludgy approach would be to use a single Text Display object with Rich Text.
Rich Text will allow you to vary the text color to your heart’s content. In fact, you can even change the background color of the text on the fly. However, I’m guessing you want to change the background color of the entire label, in which case David’s solution using an Image Display object is the approach you want to go with.
Note that the ChangeObject statement permanently changes one or more properties of a graphical object. But you don’t want to permanently change the properties of the object, you want to dynamically change a property as each record is displayed or printed. The ChangeObject command cannot do that. Dynamic changes like that can only be done via object properties that use a formula. If a property can’t be controlled by a formula, it can’t dynamically change from record to record. For example you can’t change the radius of a rounded rectangle from record to record, or the dash pattern of a border. But you can change the font, because that is controllable via formula using the Rich Text feature.
I was hoping there was some Panorama object that I could control using Dashes, stroke widths, colors, etc. Graphics are very static and a lot more work.
I would disagree about graphics being “very static”. What other application do you know of that allows you to automate the modification of graphics on the fly? Even graphics programs don’t do that, at least none that I am aware of.
But you are correct, you can’t modify most graphic characteristics based on the data in each record. I’m sorry, that does not exist, and is not on the roadmap. That would require a complete revamp of Panorama’s graphics engine, and would be very difficult to do without making graphics much more complicated for most users that just want to use the built in inspectors to set up graphics.