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

Combining data while printing 1

Status
Not open for further replies.

Shunt2

Technical User
Nov 15, 2011
6
US
I have been trying to get two Names to print out on one sheet.
Can someone help me?

Seq_Nbr ReservationID ReservationNbr Name RentalDriversID
2739 46317 16693 HUNT 47035
1552 46317 16693 KELLER 47036
 
What result are you expecting to see for the above data?

-LB
 
Do you mean that you want a single document for both detail records, rather than one for each?

If so, you first need to group them by ReservationID / ReservationNbr, first combining them in a single Formula Field if necessary. You can then collect details from a group and show them all in the group footer. Try adapting something I wrote to collect postcodes:
Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} +", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field in the group header.
whileprintingrecords;
stringvar pst := "";
Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
First drivers name appears and then on the next page both drivers names appear.
This carries on when I run my report/
 
You should have a group on reservation ID (Or reservation number?), and then suppress the accumulation formula and put the "show" formula in the group footer, and the "clear" formula in the group header. Then you could suppress the details section if you wish.

You didn't really explain what you wanted the final report to look like. You should explain your grouping and what you are trying to do with the names.

-LB
 
Seq_Nbr ReservationID ReservationNbr Name RentalDriversID
8450 44349 16088 Shawn 123456
692 44349 16088 Justin 7891011


I need for my form to print both Names on one line

Reservation: 16088
Requested Driver Name(s) Shawn, Justin

I am horrible at explaining :(
 
So you would group on reservation, and drag the groupname into the group footer. Then add the formulas as indicated earlier and then add the display formula in the group footer, and suppress the other sections.

What problem are you running into?

-LB
 
It still is having a problem.
On the first page it puts Shawn
then on the following page it puts Shawn , Justin
I grouped by reservation number
 
Show the contents of the formula that is returning these results, and identify the section in which you placed this formula.

Note that placement of the formulas MUST be in the sections identified in Madawc's post.

-LB
 
Group by reservationnbr

Group Header (suppressed)-----------------------------
// Clear using a formula field in the group header.
whileprintingrecords;
stringvar Name := "";

Detail (Not supressed) I need the reservation to print out on paper---------------------------------
// Accumulate using a formula field (suppressed) in the detail line. Allow for nulls and blanks.
whileprintingrecords;
if not isnull({MP_DRIVERSLICENSE.Name}) and {MP_DRIVERSLICENSE.Name} <> ""
then stringvar Name := Name + {MP_DRIVERSLICENSE.Name} + " / "
else if length(Name) = 0
then stringvar Name := Name + "No Driver Assigned Contact Department"
else stringvar Name := Name


Group Footer-------------------------
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar Name;
left(Name,len(Name)-2)

Reservationnbr

// Clear using a formula field in the group header.
whileprintingrecords;
stringvar Name := "";





If I have 4 drivers listed on the reservation
the first page prints Driver 1
the second page prints Driver 1, Driver 2,
the third page prints Driver 1, Driver 2, Driver 3
the fourth page prints Driver 1, Driver 2, Driver 3, Driver 4

So actually it works but, I don't want to print the first 3 I just need to have all the drivers listed on on sheet! You have been an awesome help thus far
 
You have to be referencing the incorrect formula OR placing the display formula in the wrong section. The display formula belongs ONLY in the group footer, NOT in the page footer.

Please clarify--can one reservation take four pages? If you want all drivers to print on every page for that reservation, then use a different method: You might want to insert a crosstab in the reservation group header that uses reservation as the row field, driver as the column field (suppressed) and maximum of driver as the summary field. You can suppress the row label if you want anda also remove selected grid lines, if you wish.

-LB
 
I am looking for all drivers that are attached to the reservation number to print on the same page. I have been trying so hard. I really appreciate your help :)I will keep playing around with it. I know where there is a will there is a way!
 
You need to check where you are placing the formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top