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!

Closing up rows in detail section 1

Status
Not open for further replies.

lambic

Technical User
Nov 28, 2002
68
GB
Hi,

Im using Crystal 10 with a SQL Server 2000 Database.

I have a table which contains one or more records for a given record ID field. Each record has address line columns, Address1 - Address4, and 3 boolean fields to indicate what type of address it is, Type1, Type2 or Type3. The address can be 1 or more types, there may be mutiple address records for any given record ID:

e.g. 1 (X just represents character data)

ID Address1 Address2 Address3 Address4 Type1 Type2 Type3
1 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 1 0 0
1 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 0 1 1
1 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 0 1 0
2 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 1 0 0
2 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 0 0 1
2 XXXXXXX XXXXXXX XXXXXXX XXXXXXX 0 1 1


My report is grouped on the ID field, and is required to show the address in 3 different columns depending on which type it is. The example below is how it should look:

e.g. 2 (X represents the formatted Address data in one field, Address1-4)

ID Address Type 1 Address Type 2 Address Type 3
1 XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX


2 XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX

XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX


However, the report I have formats the data as shown below:


e.g. 3 (X represents the formatted Address data in one field, Address1-4)

ID Address Type 1 Address Type 2 Address Type 3
1 XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX

XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX

2 XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX

XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX

XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX

Each address block field is one row in the detail section of the report.

So what I need to achieve somehow is the address blocks ‘closed up’
(i.e. to fill each row in the detail section)

I hope my description isn’t too confusing!

Thankyou in advance
 
Use formulas to get the addreses in the details, and uses the GroupFooter as your display area:

Group Header Formula:
whileprintingrecords;
stringvar add1 := "";
stringvar add2 := "";
stringvar add3 := "";
stringvar add4 := "";

Details formula:
whileprintingrecords;
stringvar add1;
stringvar add2;
stringvar add3;
stringvar add4;
If {table.AddressType} = "blah1" then
add1 := {table.AddressType}
else
If {table.AddressType} = "blah2" then
add2 := {table.AddressType}
else
If {table.AddressType} = "blah3" then
add3 := {table.AddressType}
else
If {table.AddressType} = "blah4" then
add4 := {table.AddressType}

Now suppress the details section and in the group footer place the display formula fields:

whileprintingrecords;
stringvar add1;

whileprintingrecords;
stringvar add2;

whileprintingrecords;
stringvar add3;

whileprintingrecords;
stringvar add4;

-k
 
Thanks Synapsevampire.

Have managed to sort it now with your help.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top