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

Help with multi-column layout

Status
Not open for further replies.

Elanger

Programmer
Jan 9, 2002
17
US
I'm looking for help with the following layout, using Crystal 8.5:

There should be two columns on the report detail section.
If field1=x, print in the right column ... otherwise print on the left column. BUT I don't want blank lines on either side, so I can't just put conditional suppressing in the detail lines.

The report should look like this:

PAYMENTS TYPE 1 | PAYMENTS TYPE 2
-------------------------------------------
DATE CHK AMOUNT | DATE CHK AMOUNT
|
99/99/99 123 100.00 | 99/99/99 345 200.00

There are no groups, just detail records from a single table.

Is there a way to do this?

Thanks!
Elky Langer
 
Make two subreports, one for each column (or payment type)
with identical layouts. Put these into a master report which returns just one record (or suppress details). Make each subreport the width of the corresponding master report column and place them side by side.
 
I would do it this way:

first an initialization formula placed in the report header
suppressed

@initialization

WhilePrintingRecords;
StringVar Payment1Date := "";
stringVar Payment1Chk:= "";
StringVar Payment1Amt:= "";

StringVar Payment2Date:= "";
stringVar Payment2Chk:= "";
StringVar Payment2Amt:= "";

In the detail section (suppressed) I would have a formula that separates the records into six variables

@calculate

WhilePrintingRecords;
StringVar Payment1Date;
stringVar Payment1Chk;
StringVar Payment1Amt;

StringVar Payment2Date;
stringVar Payment2Chk;
StringVar Payment2Amt;

If {table.PaymentID} = "Payment1" then
(
Payment1Date := Payment1Date +
totext({table.date},'yyyy/MM/dd') +
Chr(13) + chr(10);
Payment1Chk := Payment1Chk +
{table.chk} + Chr(13) + chr(10);
Payment1Amt := Payment1Amt +
totext({table.Amt},2) +
Chr(13) + chr(10);
);

If {table.PaymentID} = "Payment2" then
(
Payment2Date := Payment2Date +
totext({table.date},'yyyy/MM/dd') +
Chr(13) + chr(10);
Payment2Chk := Payment2Chk +
{table.chk} + Chr(13) + chr(10);
Payment2Amt := Payment2Amt +
totext({table.Amt},2) +
Chr(13) + chr(10);
);

Now in the Page or report footer I would create the report you want using 6 formulas of the type

@display - Payment1 Date

WhilePrintingRecords;
StringVar Payment1Date;

Payment1Date;


Make this field "Can Grow" as well as all the other 5 display formulas and place them appropriately across the footer

Making 6 formulas in this manner means that they will line up perfectly as you add data in the Calc formula.

hope this helps
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top