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 to combine multiple records into a single row in the report

Status
Not open for further replies.

krishna

Programmer
Mar 30, 2000
121
IN
Hi

I am using CR 9. I want to create a report which combines multiple records into a single row. For example the table contains the details of the building owned by a person in a location. Each building will have a number. All the other fields are common for the records. I want to combine this records and show like

Name Location Building Details
Krishna Kumar XXXXXX 9/165, 9/166,9/167

which is actually 3 different records in the table.

Thanx in advance.

Regards
Krishna Kumar
 
Use a variable and the three formula technique to build up a string with the values you want.

Group the Report by Name/Location and Suppress the Details
Set the variable to "" in the Group Header
Build up the string using a formula in the Details
Display the string in the Group Footer.

Remember all formulas using variables like this need to be WhilePrintingRecords Editor and Publisher of Crystal Clear
 
Hi

I created the formulas and it worked. Thanks for your help.

Regards
Krishna Kumar
 
Hi, I am new to this 3 formual technique.. can u pls. let me know what it is , and how one does it.. u talk of "Use a variable and the 3 formula techinque to build up a string with the values u want">> Can u pls. elaborate how one does this. Thks
Usha
 
Hi

You have to create 3 formulas and place them in 3 different section namely Group Heade, Detail and Group Footer. The detail section should be suppressed. The group footer section should contain the fields which you want to place in the detail section. The column whose value you want to combine in differnt records will be there in the formula. Here are the fomula.

Group Header
-----------

Formula1

whileprintingrecords;
string var strCombine;
strCombine:=''

Detail
--------

Formula2

whileprintingrecords;
string var strCombine;
if strCombine='' then strCombine:={Field} else strCombine:=strCombine+{Field}

Group Footer

Formula3

whileprintingrecords;
string var strCombine;
strCombine


I hope this will help you.

Regards
Krishna Kumar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top