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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional format in crosstab 1

Status
Not open for further replies.

BHScripter

Technical User
Aug 26, 2002
159
US
Hi:
I have a report which is grouping based on the following hierarchy:
propertyname,
eventtype (rented or available),
floorplan style,
apartmentcategory (standard or non-standard pricing),
apartment#

I have a crosstab in the apartment # group which basically lists by lease term the rent for choosing that particular lease term. I don't necessarily need the crosstab it just lines everything up really nicely. I have the summary as Sum and I am suppressing the Grand totals. There is really nothing to sum as there is only 1 value for each lease term. it looks like:
Apartment 100 (group)
2 month 3months 4months 5months 6months (etc...)
1500.00 1275.00 1100.00 1090.00 1000.00

I need to be able to bold the rent that is the minimum.
I have tried to set a formula on the font style for the rent field in the crosstab:

if Minimum ({Command.Rent}, {Command.AptCode}) = {@minimumrent} then crBold else crRegular


and the formula for the minimum rent calc works as I checked it by making that field visible in the same group.

However, with the above formula each of the summary amounts for every month comes out bold.

Thanks in advance for any assistance.
 
This is probably more complex than its worth, but it works. Add a field to the Select statement of your command like this:

(
select sum(`rent`)
from table A
where
A.`propertyname`=table.`propertyname` and A.`leaseterm`=table.`leaseterm` and
A.`aptno`=table.`aptno`
) as sumrent

Then create a formula in the main report like this:

//{@minofsum}:
minimum({command.sumrent},{command.apt#})

Add {@minofsum} as your first summary field in the crosstab, and insert a minimum on it. Right click on it in preview mode->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar min := currentfieldvalue;
true

Then add your original summary as the second summary. Right click on it->format field->font->style->x+2 and enter:

whileprintingrecords;
numbervar min;
if currentfieldvalue = min then
crbold else
crnocolor

Resize the first summary in design mode to minimize the height.

-LB
 
Hello Again:
So now that the lowest price shows as bold, they love it! However, now they want the lease term (crosstab column header) above the lowest price to also be bold. Is there any easy way to do that?

Thanks so much!
 
I can't think of a simple way to do this, since the bolding of the summary is based on running totals that are calculated after the crosstab is executed.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top