Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using arrays or loop? Post Reply Post New Topic
Author Message
fasdl
Newbie
Newbie
Avatar

Joined: 09 Jan 2008
Location: United States
Online Status: Offline
Posts: 2
Quote fasdl Replybullet Topic: Using arrays or loop?
     Posted: 09 Jan 2008 at 12:40pm
Hello,
 
I am designing a Form and I need to show the contact info for each individual. At the same time each individual has several (around 12)contact_type in diferent table, but this number cans vary depend if the field has or not info. 
 
Table 1
Ind_ name   
 
A
B
 
Table 2 Ind_A
Contact_type   Contact_number
 
Home                123456268
business           789456123
Email
Cell                   
 
 
Table 2 Ind_2
Contact_type   Contact_number
 
Home               
business           789456123
Email                 abc@kkkkkk.net
Cell                   896456617496
 
for individual A I have Home and business, for Indvidual 2, business, mail and Cell.
 
QUESTION:  How I can bring all the contact_type that I should have and show these data when is filled and how I can put a grey o line to be filled when is empty?
 
If I bring these info in details I get only the Contact_type that I have.
 
Please, help.
 
 
FAS
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 Jan 2008 at 3:11pm
It's a bit of a tricky question. I would create a global variable for each type of contact info and have a formula which assigns the Contact_Number data to the appropriate variable using a Select Case statement. I would put this formula in the Details section so that the variables get populated for each record. But I would also suppress the Details section so that you don't see the data yet. Then in the group footer, show all the formulas in their own Group Footer section (one formula per section) and use conditional formatting that tests if the variable doesn't have data, then make the section have a grey background color.

This will take a bit of coding, but it is very possible to do.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
fasdl
Newbie
Newbie
Avatar

Joined: 09 Jan 2008
Location: United States
Online Status: Offline
Posts: 2
Quote fasdl Replybullet Posted: 10 Jan 2008 at 8:45am

Yes, it was a little tricky the solution too, but programing it works. I forgot to mention that the order of the Contact_type is not always de same, but I hadled it using the variable as a Default case in the Select_case.

Thank you very much for your help. I will take care about the link.Clap
 
 


Edited by fasdl - 10 Jan 2008 at 8:46am
FAS
IP IP Logged
Printable version Printable version

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