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

Multiple records, select by field type, report on same line?

Status
Not open for further replies.

oneiblnd

IS-IT--Management
Sep 20, 2002
3
US

Field 1 types "A thru Z".

Record 1 = Field 1 contains the value "A", Field 2 contains amount.
Record 2 = Field 1 contains the value "B", Field 2 contains amount.
Record 3 = Field 1 contains the value "C", Field 2 contains amount.
Record 4 = Field 1 contains the value "D", Field 2 contains amount.
etc...

I want a report that only reports Field 1 type "A & B" amounts on the same report line. How?

Example:

Record1 A 750
Record2 B 900
Record3 C 1000
Record4 D 500
etc.

Report
(A)price (B)price
-------- --------
$7.50 $9.00








 
Inserting a crosstab might be the easiest way.

If you create a formula first which contains:

"(" + {MyTable.MyLettersField} + ")price"

to use as the Columns header, and then just place your value field in the summarized Fields area.

If you only want the A and B rows, add something akin to the following to the record selection criteria (Report-Edit Selection Formula->Record):

{MyTable.MyLettersField} in ["A", "B"]

-k kai@informeddatadecisions.com
 
You could also use conditional totals. The difference is that conditional totals will show fixed columns and cross-tabs will only show columns when there is data for that column.

Conditional totals are described in faq149-243. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top