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!

How do multiple detail sections work? 1

Status
Not open for further replies.

McNab

Programmer
Jul 23, 2001
101
CA
Hello All,

I was just wondering how detail sections work. I have 3 different detail lines in my report. They are for different types of investments that a client may have (I work for an insurance company).

Detail a = Segregated Funds
Detail b = GICs
Detail c = Cash/Time Deposit

If someone has more than one of these can they both be printed out?

So far, it only seems to print out the Seg Funds. I made an "" of an else stmt in detail c (Cash/Time) to "Grp 3" (which is just a text word I added to test). It printed out where it should have, but then it also printed every second time in the details a (seg fund) section. I'll try to give an example of the outcome.

====================================
=INVESTMENT HOLDING INFORMATION =
====================================
Acct Num Type Product Shares Unit Price
-------- ---- ------- ------ ----------
==========================================================
INVESTMENT VALUES - DAILY INTEREST (details c stuff ==========================================================
Grp3
Grp3(**this client has 2 invests that would print here)
======================================================
INVESTMENT VALUES - SEGREGATED FUNDS (this one works well)
=======================================================

1231232 Seg Fund EFG-Elite Fund 9.99 343.87
Grp3
3454353 Seg Fund EFG-Elite Fund 89.98 897.90
Grp3
0982221 Seg Fund EFG-Asset Alloc 4.49 24.78
Grp3
Total Invest (seg fund) = 1266.55
===========================================================

I hope this makes sense. I would appear that seg fund (details a) works fine. But when I add that "Grp3" to the else of the first line of the details c section (instead of ""), it prints twice (which is kinda right because this particular client has two investments which sould be printed in the daily interest section). But then, it comes out the the details a sections as every second line. Any ideas or suggestions whould be geate
Thx

Jamie in Canada
 
Hi Jamie;

let me ask you this....is your data grouped on the basis of "fund type"???

I am not sure what Groups 1,2 & 3 are from your post... so I will just use Group 1 as Client number, Group 2 as Account type and Group 3 as Account number

TB = text box field

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

Page hdr : (put the column header labels here)
Group1 hdr : {TB: "Client: "}{client no.} {client desc}
Group2 hdr : {TB: "INVESTMENT VALUES - "} {@fundType}
Group3 hdr : Suppress...as an alternative remove
Group3 all together and just sort by
Account no.
Detail : {Account no.) {Product} {shares} {Unit$}
Group3 ftr : supress
Group2 ftr : supress
Group1 ftr : supress

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

you will note I eliminated the fund type in the detail. I did this because you can create a formula (@fundType) to insert the value into the Group 2 header...to repeat it in the detail line can be a waste of "Real Estate" and a nuisance as well seeing repeat data for no purpose.

the formula would look like

********************** start of formula *******

WhilePrintingRecords;
stringVar Detail := "";

if {Type} = "Seg Fund" then
Detail := "Segregated Funds"
else if {Type} = "value for this case" then
Detail := "GICs"
else if {Type} = "value for this case" then
Detail := "Cash/Time Deposit";

detail;

********************** end of formula *******

As far as how multiple detail lines work...they are evaluated in their natural order. I often do this to create different looks to the report....one would control which one is displayed through a formula in the Section Expert conditional suppress.

another reason for a second detail section would be that you have a field with "can Grow" checked but you want info displayed under it....if you put that info under the "can grow" field it may overwrite your other field if it gets large enough...putting the data in a different section prevents this

hope this helps

Jim (a fellow Canadian)





 
WoW!

Thx so much Jim! You really did a great job with your response. I will try this out and hope that it works! I am using Crystal Reports 6.0 (which is crap) so I hope that it still works!

Thx again!

Jamie from Kingston, Ont.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top