Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to alternate colors in list view?

Status
Not open for further replies.

pyritz

Technical User
Nov 21, 2003
18
I am trying to recreate and update a job tracking database that was created by my predecessor (who left with the password).

The main layout is a list view. Each record (one per job) is listed in a short row. Every other record is colored (in the background) yellow or white, to make it easy to quickly distinguish one from the next.

It seems like it should be simple, but I cannot for the life of me figure out how he made the records alternate colors.

Can anyone help?

-Nathan Pyritz
 
There are two ways of doing this.

If you create a portal view, then alternating colors in the portal is a built in option. This is likely what you are looking at.

A portal is based on a relationship and is not a list view per se. You can display a portal in a scrolling list though.

The other way would involve calculations and container fields. Basically you would define a calculation whose result was a container field and have a separate white and yellow container or repetition, the calculation would draw the white or yellow based on whether the status(recordnumber) was even or odd.
 
There is a crowd who produce a product enabling you to extract passwords from FMP DBs. Sorry I cannot remember the name. Try searching on 'FileMaker passwords'.
I'm sure someone else will come up with the site.

Cheers,
Paul J.
 
I found the program which will extract filemaker passwords, but my company doesn't want to pay the $40 for it.

So I've been experimenting with portals, which I've never worked with before, and so far have not had much luck. I was able to get it to repeat the same record numerous times, with a limited amount of success on the alternating colors, but can't seem to get it to list all the records on screen at once.

And anyway, with a little further investigation, it appears that the original database used to calculation/container method to alternate colors, though i haven't been able to understand how yet.

Could anyone elaborate on the steps I would need to take to use containers/calculations to alternate color in a list of records?
 
pyritz!
if ur in jam let me know...make an empty copy of your DB+ post the link to D/L and I will get the password for you.
Anyhow,
all the best!

> need more info?
:: don't click HERE ::
 
I will write you the basic fields and calcs you need for this over the weekend. I've just been a bit busy. Hope you can wait.

Phil
 
Okay, here it is;

Create these three fields,
1) a global field of the type container <g_Stripe>
2) a calculation field set to &quot;Calculation result is Container&quot; <ContainerCalc>
the calculation will be:
If (Mod(Status(CurrentRecordNumber), 2) = 0, g_Stripe,&quot;&quot;)

This will determine if the current record is even or odd (by dividing the record number by two and determining if there is a fraction)and assign the stripe to even numbered records.

3) a calculation field <RecordNumber>
The Calculation will be:
Status(CurrentRecordNumber)

This field is actually unnecessary, I only added it in to allow you to see what is happening, you can delete it once you have your layout set up and working.

Now you will add the ContainerCalc field to your layout covering the &quot;body&quot; area and sending it to the back, and the g_Stripe field to your layout making it the same size as the ContainerCalc and placing it off to the right out of view.
You now need a colored box to copy/paste or insert into the g_Stripe field, you can make this in any graphics app or in Filemaker in layout mode make a text box with a yellow (or other color) background, click on it hit copy, go to browse mode click on g_Stripe and hit paste. You can the delete the yellow text box.

Add the Record Number field over the ContainerCalc field if you'd like and you'll see how it works

That should be it.

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top