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

ASAP! Supress if duplicated dosn't work? 1

Status
Not open for further replies.

McNab

Programmer
Jul 23, 2001
101
CA
Hey

I have a field in my "Group Header #10, Policy.Cov" called {@policy amount}. I for the example rpt I am using, it spits out $175,000.00 4 time in a row. I should only print out once at the top. I checked off "Surpress if duplicated", but it still comes out 4 time? Here is the code behind the field (if it helps but I don't think it will)...

If ToText ({PolicyLICovValue.AnnPrem}) <> &quot;0.00&quot; or ToText ({PolicyLICovValue.TotalCV}) <> &quot;0.00&quot; then
If &quot;L&quot; in {PolicyInsured.PolicyNum} or &quot;I&quot; in {PolicyInsured.PolicyNum} then
// If {Policy.ProdCode} =&quot;Vital Link&quot; or {Policy.ProdCode} = &quot;Vital Link 10&quot; then
// &quot;&quot;
If {Policy.Type} = &quot;CRI&quot; then
ToText({Policy.FaceAmt})

Else
If {Policy.Type} in [&quot;VAN&quot;, &quot;AN&quot;] Then
If ToText ({PolicyAN.AnnuityValue}) <> &quot;0.00&quot; Then
ToText ({PolicyAN.AnnuityValue})
Else
&quot;&quot;
Else
If ToText ( {PolicyLICovValue.TotalDB} ) <> &quot;0.00&quot; Then
ToText ( {PolicyLICovValue.TotalDB} )
Else
&quot;&quot;
Else
&quot;&quot;
Else
&quot;&quot;

Why does &quot;Surpress if duplicated&quot; not work????

Help please!!!

Thx

Jamie in Canada
 
Suppress if Duplicated only works in Details, not in GH.

You can suppress it based on a condition. I would create a running total that counts the records in the group, and suppress this field if the count is > 1. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ok ... sounds good to me. How do you make a counter in CR? I'm not quite sure what you mean buy counting the number of records in a group. What does the code look like? The reaccuring amount comes into a detail line.

I also have another question along the same lines. I have headers in my header section for my details to print out under. Based on what is printed, I don't want all of the titles to come in. It seems to work when there is only one detail line, but once there are a few, it doesn't work. Like if the first investment is a Vital Link, I don't want the last 5 titles to appear. This will work but if someone has &quot;Vital Link&quot; and then a &quot;Segregated Fund&quot; under it, the titles all show up?

Hope this helps ... any and all help is greatly appreciated!

Jamie in Canada
 
What version of CR do you have?
I don't understand the second question. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Hey Ken,

I'm using CR 6.0 ... and don't worry about my second questiong as i figured it out (in a giant &quot;if&quot; stmt). The problem is still that in my detail(s). If an amount comes out in the death benefit section in the first detail line, it duplicates the amt for the other detail lines under it.????????

Example
______________________________________________________
Type Issue date Death Bene. Cash Val.
______________________________________________________
Vital Link 12/11/01 50,000 0.33
Term 10 12/04/01 *50,000* 12.00
Optimax 04/05/01 *50,000* 6.74

The problem is that the 50,000 at the top (vital link coverage) should be there, but it should not show up under it with different policies. (I added the *asteriks to show where they should not be)

HELP PLZ!!!!

Thx
Jamie in Canada




 
Hey Ken,

I'm using CR 6.0 ... and don't worry about my second questiong as i figured it out (in a giant &quot;if&quot; stmt). The problem is still that in my detail(s). If an amount comes out in the death benefit section in the first detail line, it duplicates the amt for the other detail lines under it.????????

Example
______________________________________________________
Type Issue date Death Bene. Cash Val.
______________________________________________________
Vital Link 12/11/01 50,000 0.33
Term 10 12/04/01 *50,000* 12.00
Optimax 04/05/01 *50,000* 6.74

The problem is that the 50,000 at the top (vital link coverage) should be there, but it should not show up under it with different policies. (I added the *asteriks to show where they should not be)

The first line (Type, Issue Date, Death Bene. and Cash Val.) are titles in a header line. The coverages (Vital Link, Term 10 and Optimax) are from the detail line.

HELP PLZ!!!!

Thx
Jamie in Canada




 
You say &quot;details&quot; but your original question said it was in GH #10. Where is this field?

Is it a database field or formula?
What is the group field for Group 10? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Sorry Ken ... your right .. and Thanks for the very speedy reply!

It's been a long day. It is in Grp header #10. The titles are from Grp Header #9g. It is a formula field.

Here is the formula again...

If ToText ({PolicyLICovValue.AnnPrem}) <> &quot;0.00&quot; or ToText ({PolicyLICovValue.TotalCV}) <> &quot;0.00&quot; then
If &quot;L&quot; in {PolicyInsured.PolicyNum} or &quot;I&quot; in {PolicyInsured.PolicyNum} then
// If {Policy.ProdCode} =&quot;Vital Link&quot; or {Policy.ProdCode} = &quot;Vital Link 10&quot; then
// &quot;&quot;
If {Policy.Type} = &quot;CRI&quot; then
ToText({Policy.FaceAmt})

Else
If {Policy.Type} in [&quot;VAN&quot;, &quot;AN&quot;] Then
If ToText ({PolicyAN.AnnuityValue}) <> &quot;0.00&quot; Then
ToText ({PolicyAN.AnnuityValue})
Else
&quot;&quot;
Else
If ToText ( {PolicyLICovValue.TotalDB} ) <> &quot;0.00&quot; Then
ToText ( {PolicyLICovValue.TotalDB} )
Else
&quot;&quot;
Else
&quot;&quot;
Else
&quot;&quot;

**********************

I'm not sure what you mean by &quot;What is the grp field for Grp 10&quot;. It is called:

&quot;Group Header #10: PolicyLICovValue.LICovID - A&quot;

I hope this is what you meant ... plz let me know if I'm wrong ...

Thx again!!!

Jamie in Canada
 
Option 1:

Use the followng suppress formula, except use the field from Group 9, not the Group 10 field as I have here:
(Not OnfirstRecord) and
PolicyLICovValue.LICovID = Previous(PolicyLICovValue.LICovID)

Option 2:

Create a running total field using the 3 formula technique outlined in the FAQ on running totals. Have this running total count each Group 10 within each Group 9, so that you could number these 'details' as 1,2,3,etc.

Then you can suppress this field when the running count is > 1. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Thx Ken ...

Looks good to me ... I'll give it a shot!

Thx for all the help Ken

Jamie in Canada
 
Hey Ken..

I'm having trouble with Option 1 formula.

(Not OnfirstRecord) and Policy.PolicyID = Previous(Policy.PolicyID)


i get the error &quot;an numb, curr amt, bool or string is expected here&quot; and then puts the cursor right after the &quot;and&quot;.

oh ... policy.policyID is the group field for grp #9

what is wrong?

Thx

Jamie
 
This is the faq,

I'm not sure what you mean by &quot;Have this running total count each Grp 10 within each Grp 9, so that you could number these &quot;details&quot; an 1,2,3, etc.&quot;

could you possibly explain this to me.


2) Use the three formula approach.
This is reliable, but more time consuming to write.
In this example, the running total calculates the number of employees in a dept.

//goes in group header for dept, resets count to zero
WhilePrintingRecords ;
NumberVar DeptEmpCount := 0

//goes in the detail section, increments employee count
WhilePrintingRecords ;
NumberVar DeptEmpCount := DeptEmpCount + 1

//goes in the group footer for dept, shows dept emp count
WhilePrintingRecords ;
NumberVar DeptEmpCount


thx ken ... (again)

Jamie in Canada
 
Sorry Ken ...

But, where do you put the code for option 2? In the formula code box or in the surpress code box?

i think this is what i want to do:

**this part goes in the formula box**

whilePrintingRecords;
NumberVar Count := 0

WhilePrintingRecords;
NumberVar Count := count + 1

WhilePrintingRecords;
NumberVar Count;

**this part goes in the surpress code box**

if(count>1)

_______________________

plz let me know if i'm on the right track

thx again

Jamie
 
Use Option 1, and put the field names in curly brackets on both sides of the equal sign.

For option 2 you would have to create 3 formulas (One each would go in GH9, GH10 and GF9 - the display in GF9 is optional) Then you reference the formula in GH10 in your suppress condition. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Oh Ken ...

Thank you so much! It works now!!! darn curly brackets! I should have known that! I've been losing my mind lately with my work placement and 3rd year of school. I had an advanced C++ test today, so i've been studying day and night for a couple of days. Client Code, Spec file, Imp file ... yuck! Anyways ... thx again ken

Sincerly;
Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top