Green Bar printouts.
Remember the "good ol'" days of printing computer reports?
Tons of fan fold paper with alternating lines highlighted by
green or white bars.
As a result of helping another person with a similar
problem, I've discovered how to do this in a report. In
addition, the width of the colored bars can be easily
adjusted.
The steps to do so are very simple.
1. Create a Global variable call Bar_Lines.
The value assigned to it is the height of the bars that
will be shown. eg: 3
2. In the report, create a calculated field called
Bar_Height.
Name Expression
Bar_Height Var->bar_lines * 2
3. create a Dummy variable of type Character, but do not
assign any value to it.
Level Name Type Value
Layout Dummy Character
4. Drag the Var->Dummy into the detail section and stretch
it to fit the entire detail area.
5. Right click on Var-> Dummy and change the Border, Fill,
Style to solid.
For Setup, Color Equation, enter the following:
case(mod(mrecno(),calc->Bar_Size)>INT(calc->Bar_Size/2)
.OR. mod(mrecno(),calc->Bar_Size)=0,
"Light Green on Light Green",.T.,"Black on White")
6. Close the properties dialogue and right click on
Var->Dummy again.
Choose Order, To Back.
Preview the report and enjoy.
I have attached the Customer.Dbf from Alpha Sports with the
"Customer Summary List" report modified so you will have a
first hand reference.
Note: The Var->Bar_Lines is included in the report to
simplify the example. It should be replaced with an
application Global of the same name so the user can
dynamically specify the number of lines.
I have made this information available to the Alpha Five
community as a courtesy. If you find it useful, please just
send me a courtesy "thank you" email.
Regards,
Melvin Davidson
Remember the "good ol'" days of printing computer reports?
Tons of fan fold paper with alternating lines highlighted by
green or white bars.
As a result of helping another person with a similar
problem, I've discovered how to do this in a report. In
addition, the width of the colored bars can be easily
adjusted.
The steps to do so are very simple.
1. Create a Global variable call Bar_Lines.
The value assigned to it is the height of the bars that
will be shown. eg: 3
2. In the report, create a calculated field called
Bar_Height.
Name Expression
Bar_Height Var->bar_lines * 2
3. create a Dummy variable of type Character, but do not
assign any value to it.
Level Name Type Value
Layout Dummy Character
4. Drag the Var->Dummy into the detail section and stretch
it to fit the entire detail area.
5. Right click on Var-> Dummy and change the Border, Fill,
Style to solid.
For Setup, Color Equation, enter the following:
case(mod(mrecno(),calc->Bar_Size)>INT(calc->Bar_Size/2)
.OR. mod(mrecno(),calc->Bar_Size)=0,
"Light Green on Light Green",.T.,"Black on White")
6. Close the properties dialogue and right click on
Var->Dummy again.
Choose Order, To Back.
Preview the report and enjoy.
I have attached the Customer.Dbf from Alpha Sports with the
"Customer Summary List" report modified so you will have a
first hand reference.
Note: The Var->Bar_Lines is included in the report to
simplify the example. It should be replaced with an
application Global of the same name so the user can
dynamically specify the number of lines.
I have made this information available to the Alpha Five
community as a courtesy. If you find it useful, please just
send me a courtesy "thank you" email.
Regards,
Melvin Davidson
Comment