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

having problem displaying phone & fax in page header 1

Status
Not open for further replies.

HRHK

Programmer
Jun 5, 2005
83
US
I want to display phone no. and fax no. in Page header section for a Customer Contact. Currently I cannot display both at the same time. Here is my table layout.

Table name: t_contact_phone

Fields:

contact_phone_id (identity field)
contact_id
phone_type_id (1= Permanent, 2= Temp, 3 = Mobile, 4 =Fax)
phone_num_txt

Suppose there's a Contact called Tom Jones (contact_id:1234). He has permanent phone (651-272-9282) and fax (651-938-3736).
Then t_contact_phone table will look like:

contact_phone_id: 1
contact_id: 1234
phone_type_id: 1
phone_num_txt: 651-272-9282

contact_phone_id: 2
contact_id: 1234
phone_type_id: 4
phone_num_txt: 651-938-3736


How can I display both phone number and fax number in
the header section for this contact? I will really appreciate your suggestions very much. Thanks.

I tried w/o success the following:
I put phone_num_txt in page header section twice and put following condition for each phone_num_txt field.

To display phone number, I put suppress condition of following:
{t_contact_phone.phone_type_id}<>1

Then to display fax number, I put suppress condition of following:
{t_contact_phone.phone_type_id}<>4

It displays the phone number on both fields: 651-272-9282
 
If you insert a group on {contact.id}, you could display both in the group header (instead of the page header) by creating two formulas:

//{@type1}:
if {table.phonetypeid} = 1 then {table.phonetext}

//{@type4}:
if {table.phonetypeid} = 4 then {table.phonetext}

Then place the formulas in the detail section and right click on each formula and insert a maximum. Then drag the result into the group header.

-LB

 
Thanks lbass, it worked out great!!
I would like to know what is the purpose of right click
and insert maximum by selecting Summary. Thanks again!!
 
The formula will result in the address only in one detail row; otherwise the result will be "". You can see this if you unsuppress your detail section. A maximum will then give you the address in the group section, since anything other than "" will be considered "higher" than "". If you just place the detail field itself in the group header, you will see that it will appear in the group header the same way as in the detail section ONLY if the result appears in the first detail row.

-LB
 
Another quick ques came up that I would like to resolve ASAP. I have a amount field called 'approvedAmt' in the detail section grouped by customer. I want to show grand total amount for a customer. So I put this field on the detail section, right clicked and selected Grand Total and inserted the Sumof@ApprovedAmt in the group header. The problem is: there are some duplicates in the detail field
which I suppress using the following formula:

{t_cust.cust_id} = previous ({t_cust.cust_id})

However, the Grand total formula still calculates the
amount from the duplicate items and the grand total is off.
How can I fix this problem? I appreciate your help.
Thanks again.
 
You should be using summary, not grand total, as this would be a summary at the group level. But anyway, you can't use an inserted summary if you have duplicates, as it will include the dupe data. To handle this, you would need to use a running total to be displayed only in the group footer. If you need it in a group header, I think you will need to insert a subreport where you can set it up so that it doesn't contain duplicates (with only one or two tables), and then link this to the customer ID and place it in the group header. Suppress all sections within the subreport except the report footer where your sum is (in this case, since the subreport is linked on the group field, the grand total will be for the group).

-LB
 
Hello again,
I added a subreport and put it in the detail section in the main report. Strangely, the subreport appears more than once in the main report. What could be the reason? Thanks.
 
The subreport will appear as many times as the detail field. You should place it in a group header section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top