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

2 Columns (Same Field) in Details Area...how??? 1

Status
Not open for further replies.

Drakhan

Technical User
Jun 3, 2002
67
0
0
US
Situation:

Single database field, we'll call it: CONTACT.CLASS This field goes in to the Report to display values such as A, B, C, X, Y, Z. What I would like to do is seperate into two columns A,B,C and X,Y,Z. See below for an example

A,B,C X,Y,Z
------------------
A X
B Z
B Y
C X
etc. etc.

How can I do this? I've tried grouping and formating and nothing seems to let me seperate this data out from the same field...any suggestions??? Thanks in advance!!!
 
It seems to me that this would not work because the detail section would contain a line for each individual record in the table. I don't think you can list more than one record in the table on the same detail line. Your report would look like this:
A,B,C X,Y,Z
------------------
A
B
B
C
X
X
Y
Z
etc. etc.


Have you tried a cross-tab report? I haven't worked with those very much but you might have better luck with that, maybe setting up a formula based on the data value?
 
What if you create two formulas?
example:
1st formula:
If CONTACT.CLASS in ['a','b','c'] then
CONTACT.CLASS

2nd formula:
If CONTACT.CLASS in ['x','y','z'] then
CONTACT.CLASS

place the formulas side by side in the detail section. Just an idea...
 
I believe you'd still get the following results:

A,B,C X,Y,Z
------------------
A
B
B
C
X
X
Y
Z
etc. etc.

The reason is that A is a record, X is another, C is another, etc. and if the 1st record is A, it will appear in the "ABC" formula, then if the second record in the table is "Z", it will appear on the 2nd line in the "XYZ" formula, such as this:

A,B,C X,Y,Z
------------------
A
Z
B
C
X

The two formulas will never have values on the same line because one record can only contain one value. Make sense?

 
Try Format with Multiple Columns in the Section Expert, select "Down, Then Across" and size for two columns. Sort your data in alphabetical order by Contact Class. This will give you two columns, with the first half of the data in column 1 and the second half in column 2.
 
Thanks, I did not know that option was available. I may try it out!
 
I just tried this on a field in our database, and it displayed the same data on both fields for each line
 
Drakhan,
You may need to try the cross-tab report instead. Try using two formulas for each field
 
Thank you all for your responses. I've tried some of these suggestions and nothing has seemed to fix my situation. How would I go about just doing it this way? See below:

A,B,C X,Y,Z
--------------
A
B
B
C
X
Z
X
Y

I can't even get Crystal to do that...what I receive is this:

A,B,C X,Y,Z
---------------
A A
B B
B B
C C
X X
Z Z
X X
Y Y

Arrgghh! I would totally accept them being sperated...
 
I can think of maybe 2 ways:
1) formula 1 as:
if fieldname in ("A","B","C") then fieldname
And formula 2 would be:
if fieldname in ("X","Y","Z") then fieldname

Then arrange your detail section:
Formula1 Formula2

Then sort by formula2, then formula1

or 2) Use the format Multiple columns, and then use a suppression formula on both fields. For column 1, you would suppress formula1 if fieldname value = X, Y, or Z and suppress formula2 if fieldname value = A, B, or C

I think either of these would work, although I would suggest using the two formulas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top