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

Conditionally format one field based on another field 1

Status
Not open for further replies.

pamaley

Technical User
Nov 19, 2008
5
US
Desired results: To highlight companys that belong to more than one program. Programs is the 1st level group, then companys are the 2nd level group which are followed by accounts [detail section] information of which the program field belongs in. To add to any confusion, the company table is indirectly related via a sub-company table [which is not on the report] to the accounts table. So basically what is desired is to see companies highlighted that are listed under another program. Any help would be appreciated [if you can understand it].
 
If you main listing is programs / companies / accounts, then you'll need a subreport to group it the other way, companies / programs / accounts. Put it in the report header or footer. Use a summary total distinct count of programs within companies, and use Report > Selection Formulas > Groups to suppress those with just one company. (It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever.)

It is also possible to do a crosstab, but that would show all companies.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I think you should place a subreport in the company group header2_a section, with the company info in the Gh2_b section. Link the sub to the main report on the company field, and in the sub, add the programs. Create a formula:

whileprintingrecords;
shared numbervar cos := distinctcount({table.program});

Place this in the sub report footer. Then in the main report->section expert->group header_b->color tab->background->x+2->enter:

whileprintingrecords;
shared numbervar cos;
if cos > 1 then
cryellow else
crnocolor

Add a reset formula to GF_2:
whileprintingrecords;
shared numbervar cos := 0;

You can suppress all sections within the subreport, format the subreport object to "suppress blank subreport," and then go into the section expert->GH2a->check "suppress blank section". Then GH2a should disappear altogether from the display.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top