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

"Suppress if duplicated" not working 1

Status
Not open for further replies.

ind123p

Programmer
Sep 28, 2005
62
I am using Crystal Report XI.

I have a employee Profile report.

There are no groups in the report.


Report Layout is as shown below

---------------------------
Da EmpID EmpFName EmpLName
SSN DOB
----------------------------
Db AddrType Addr
----------------------------
Dc PhoneType Phn
---------------------------
Dd EmailType Email
---------------------------
De Referrals
---------------------------

Upto this point everything works fine.

I need to have a label before every new section.

For example,
before "Db" I need "Employee Address Information" Label,
before "DC" I need "Employee Phone information" label..and so on

My problem:

The label keeps repeating.

"Employee Phone information"
Work Phone 312-565-2363
"Employee Phone information"
Home Phone 212-365-2363

This is what I need
"Employee Phone information"
Work Phone 312-565-2363
Home Phone 212-365-2363


I tried "suppress if duplicated", but it suppresses both the labels.


How do I accomplish this ? I am probably missing something very obvious ?
 
Are you missing something very obvious? Well, I think you might have.....

I might suggest that you group on EmpID (and a Possible Group 2 on PhoneType) then get rid of the multiple detail sections and put everything on 1 row.

DataDog
'Failure Is Not An Option'
 
DataDog,

Thanks for your suggestion and your time !!!

I cannot group on the EMP iD. The reason being, the user should be able to order by EMPID, FNAME, LASTNAME. If I group by EMPID , I will not be able to order by above fields.

Also the address, phone, email, referrals will be displayed on the report if the user wants to see them. So I have parameters too that decide what need to be displayed on the report.

So I think I will have to stick with "multiple detail section" design of my report. If there are any other approaches that will will work, I am open to those...
 
Try formatting the detail section in which you are placing the text (I'm assuming you are placing this in a separate detail section) to suppress (section expert->details->suppress->x+2) using:

{table.employeeID} = previous({table.employeeID})

-LB
 
LB,

Yes I have a separate detail section for the text. I added
the code you mentioned in the detail section of the text.

Now it is suppressing both the labels.

I am getting

Work Phone 312-565-2363
Home Phone 212-365-2363

Text "Employee Phone Information" not displaying...

What do you think is wrong here ?
 
If you have it laid out like this:

det_a employee name or ID
det_b address
det_c "Employee Phone Numbers"
det_d phone type phone //etc.

Then if you go to the section expert->detail_c->suppress->x+2 and enter:

{table.employeeID} = previous({table.employeeID})

...then only the first instance of the text should appear for each employee. I'm assuming that you have "suppress if duplicated" checked for all other detail sections and that you have "suppress blank sections" checked for all also. This also assumes that you have a record sort on ID or name.

-LB
 
can't you have both the phone number fields under one label? I mean

your label in Detail C"Employee Phone information" and
Your field in detail C Work Phone {Table.Field} then
again in Detail C beneath "work Phone" Home Phone field!

which should result in
"Employee Phone information"
Work Phone 312-565-2363
Home Phone 212-365-2363

 
LB,

I have done the following

det_a employee name or ID
det_b @txtaddress
det_c Address
det_d @txtphone
det_e phone type phone //etc.
det_f @txtemail
det_g emailtype email //etc.

@txtaddress
-------------
if isnull({emp.ADDR}) or trim({emp.ADDR})= "" then
""
else
"Address Information"

@txtphone
-------------
if isnull({emp.PHN}) or trim({emp.PHN})= "" then
""
else
"Phone Information"

@txtemail
-------------
if isnull({emp.EMAIL}) or trim({emp.EMAIL})= "" then
""
else
"Email Information"

"Da"
Suppress Blank Section
Suppress (x+2)-- {emp.empid} = previous({emp.empid})

"Db"
Suppress Blank Section
Suppress (x+2)-- {emp.empid} = previous({emp.empid})

"Dc"
Suppress Blank Section

"Dd"
Suppress Blank Section
Suppress (x+2)-- {emp.empid} = previous({emp.empid})

"De"
Suppress Blank Section

"Df"
Suppress Blank Section
Suppress (x+2)-- {emp.empid} = previous({emp.empid})

"Dg"
Suppress Blank Section
*********************************
This is what I get

Address Information
Office address blah blah
Fax blah blah
Home Phone blah blah
Work Phone blah
Personal email blah blah..

I always see the first text.. For records where address is blank I see the following

Phone Information
Home Phone blah blah
Work Phone blah
Personal email blah blah..

What is going on here ?? Please help
 
You should only be using the suppression formula using previous for the employee ID and the text fields. For the the other fields, use "suppress if duplicated". I think you should also have records sorted by employee ID, address, phone, e-mail, etc. If you want to use a parameter on the first field, you can use a formula:

if {?sort} = "ID" then {table.ID} else
if {?sort} = "First Name" then {table.fname} else
if {?sort} = "Last Name" then {table.lname}

Use totext() on the ID field if it is a number, and format it with numbers equal to the maximum number of digits in the ID field, as in: totext({table.ID},"0000") so that it sorts correctly. Make this formula your first sort field.

-LB
 
LB,

Thanks for your suggestions!!!

It works great now...Star for you!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top