logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Highlighting Alternate Report Lines
K8ZM
#1 Posted : Thursday, October 25, 2018 10:36:04 AM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 524
Location: Mentor, OH

Thanks: 123 times
Was thanked: 185 time(s) in 166 post(s)
Does anyone know if its possible to highlight or shade alternate rows in a report printout ?? My expertise is in Excel and its simple to do there but I know nothing about FoxPro. Tried to search on it but it appears its more complicated than I was hoping. I'm just looking to make my reports easier to read by applying a light gray shade to alternate rows, it would be nice to have that as a feature in the report viewer as well but don't think that's at all possible. Any help appreciated.

Thanks & 73, de Brad
Sponsor
Note: We receive a commission from Amazon when you purchase via this link. It does not affect your cost. Thank you!
vk4iu
#2 Posted : Thursday, October 25, 2018 4:55:43 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
G'Day Brad,

Create a "rectangle" that sits behind all the fields in the detail line. Make it expand as the detail line expands. Make the fill color what you would like and set the "Print When" to a logical formula that alternates between TRUE and FALSE.

When "Print When" calculates to FALSE nothing of this rectangle is printed. When TRUE this rectangle is printed as a background color to the entire detail line.

Something like MOD(counter, 2) = 1 which alternates between the remainder of 0 or 1, and "prints when" the remainder equals 1

Peter VK4IU
You can help by posting images of any errors and including your Logic version.
2 users thanked vk4iu for this useful post.
WN4AZY on 10/25/2018(UTC), K8ZM on 10/25/2018(UTC)
K8ZM
#3 Posted : Thursday, October 25, 2018 6:56:28 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 524
Location: Mentor, OH

Thanks: 123 times
Was thanked: 185 time(s) in 166 post(s)
Hi Peter, hope you are well !!

Okay, I got the easy part of this, I created a filled rectangle no problem (hi hi). I tired the expression MOD(counter,2)=1 but it doesn't like the term counter. Maybe I'm not getting this, so, can I use an expression in "print when" like RECNO())=1, it took the expression but only shades the first record. I thought RECNO is the record number and the 0 or 1 represents an even or odd record number. I can make excel dance to Michael Jacksons Thriller but for some reason this is confusing me....

de Brad


Update: I got it !! I used the expression (RECNO())% 2 = 0 and it works like a champ !! Very nice !!!

Thanks Peter !!

73 de Brad, N8GLS
vk4iu
#4 Posted : Thursday, October 25, 2018 7:39:04 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
G'Day,

I am well. Thank you.

Modify your report in the usual way. Then under the menu Reports, Data Grouping, Variables you can create a variable that increments for every detail line.

RECNO() may not be a good choice as some records may be printed, or not, and the order my not be what you think.

Create your own report line "counter" under the menu above ...

Value to store = 1
Initial Value = 0
Reset value based on report
Calculation type = Sum

... and reference that value in the "Print when".
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
1 user thanked vk4iu for this useful post.
K8ZM on 10/25/2018(UTC)
K8ZM
#5 Posted : Thursday, October 25, 2018 8:22:47 PM(UTC)
bwilliams

Rank: Advanced Member

Groups: Registered
Posts: 524
Location: Mentor, OH

Thanks: 123 times
Was thanked: 185 time(s) in 166 post(s)
Peter,

Again thanks !! I can see where RECNO may give inconsistent results. I added the report line as you suggested and it works perfectly !!

Thanks much !! I'm sure other users here would like to add this feature to their reports, I know my eyes will much happier seeing the alternate rows highlighted !!

Best 73's de Brad !!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.034 seconds.