Record color workaround?

In earlier versions of Pan we could choose record color in the data sheet. This came in handy for highlighting certain records. For example, I have a form that shows the different classes we judge vehicles in in our car shows. This form is used by the judges at the entrance to class a vehicle. In the past many mistakes were made classing the vehicles since everything was one color. When i changed to highlight Mustangs and Corvettes in their own classes it nearly eliminated the error factor. The printed class sheet would look like the attached image.

HOWEVER… in Pan X this is no longer possible unfortunately. Hopefully it will be back soon but in the meantime dose anyone have a suggestion as to what to do so when I produce this form so I can have colors?

This is not difficult to do. Assuming you have a form to use for printing with tiles for your header, footer, and data, and the form is View-As-List format. The data tile, I assume, has four text display objects for the line of data your are outputting: Class, Year, Type, and Group. Make sure Rich Text is enabled for each of those text displays. For each text display, use this format for the Formula:

?(Type match "Mustang","<color:FF0000>",
      ?(Type match "Corvette","<color:0000FF>",""))+Class

As always, there are probably other ways to do this, and possibly better ways, but this one will work. You can send this to a PDF or directly to a printer using the printtopdf statement.

As Tom points out, Rich Text is the answer. Here is a quick example I made of a View as List form containing the objects Tom noted and assigned to three of my fields. Mine is set to color records that contain a couple of different City names.

To get the entire record to be colored you have to add the Rich Text formula to each Text Display Object and only change the name of the field at the end of the formula. Here is my example:

Thanks guys. I can’t get it to work but I’m sure it’s something minor I’m missing:
Form is View as List
All three Text Display objects are Rich Text
All three mode set as Formula
All three have this in Formula box:
?(«Year/Type» match “Mustang”,“color:FF0000”, ?(«Year/Type» match “Corvette”,“color:0000FF”,""))+the name of the field

So what am I missing?

Ops, I didn’t notice that Tom’s formula had the less than and greater than tags removed when it was posted. It should be:

 ?(«Year/Type» match “Mustang”,“<color:FF0000>”, ?(«Year/Type» match “Corvette”,“<color:0000FF>”,""))+the name of the field

AAaarrgg… never mind, it just dawned on me the problem is with “match”, I changed “match” to “contains” and it works now.

Thanks guys

And now a new problem… when I try to Preview the form I get an error as you can see in the image. If I try to print Pan X crashes. Other forms in the database print fine, just this one is affected.

EDIT: OK, I had the three Text Display objects set to Expandable. When I turn that off the Preview and Print work fine. Bug?

It’s a known bug, #907 on the BitBucket listing, first reported last March. Supposedly variable height printing of standard text works ok, but not with rich text. But without using rich text you won’t have the color text form you desire. So until Jim gets around to fixing it you’ll have to pick which to do without.