Alternating row colors

I’m creating a new form (View → New Form), using the Construct → Report functions.

I can manipulate the objects to get the report to look the way I want.

HOWEVER, I am unable to figure out how to make the rows alternate in color (light and shaded).

In Graphics mode, from within the Form Properties for the Data object, I tried changing the Bknd Color but and that does not change the row colors.

How is this done?

Thanks.

I was able to come up with a heavy-handed work around to get this type of report printout with alternating record backgrounds. It requires adding a background Image Display Object and formula to the Data tile and enhancing your print or preview procedure (or creating a new one if you don’t already have one).

On your Report Form in Graphics mode:

  1. Select all the current objects in the Data tile & “Bring to Front” (Objects/Arrange menu).
  2. Create a new Image Display Object the same size as the text area of the Data Tile.
  3. Enter this formula in the Formula panel of the Image Display Object:
    catcherror(“%%FFFFFF”,?(Temp=1,“%%EEEEEE”,“%%FFFFFF”))
    The catcherror function will keep an error from being generated if the Temp field is not currently added to the Data Sheet. The two color values I have used are white (%%FFFFFF) and light gray (%%EEEEEE). You can adjust these to suit your preferences.

In your Print or Preview Procedure:

  1. Add this code before your Print or Preview statement:
 		addfield "Temp"
 		Field "Temp"
 		fieldtype "INTEGER"
 		formulafill seq() mod 2
		//Print or Preview here
  1. After printing is all done, run this code to remove the Temp field:
			Field "Temp"
 			deletefield

This code creates a temporary integer field and populates it with alternate 1’s and 0’s using the seq( function and the mod operator. Now when the report is printed any line with a 1 in the Temp field will have a white background and any with a 0 will be gray.

1 Like

Wow. Amazing. I’ll update this. Thank you.

Yup, Gary’s solution is the only way this can be done in Panorama.

However, if you are printing only data records, I think you can skip the part about adding a temporary field, and instead use the info(“printsequence”) function.

The formula in your Text Display object would be something like this:

"%%"+?(info("printsequence") mod 2,"EEEEEE","FFFFFF")