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

Printing specific values Crystal 9.0

Status
Not open for further replies.

cfriedberg2

Programmer
Aug 13, 2005
34
US
I have a report that has records with POXXXX and SOXXXX for which I want to accumulate totals. I am doing this by suppressing the details and displaying only the Group Footer. XXXX in both of these fields determines the group. There may be several detail records that are summarized. I can get the POXXXX or the SOXXXX to print if it is the last detail record in the group.

I have tried the WhilePrintingRecords suggestion in the User Guide but I am not successful 100% of the time.

Reset formula
WhilePrintingRecords;
stringVar PO:= ""

Detail formula
WhilePrintingRecords;
stringVar PO:= If Mid({Command.trans},1,1) = "P" then {Command.trans}

Display formula
WhilePrintingRecords;
stringVar PO

It seems as though I cannot maintain the value I need.

Help please,
Carolyn
 
Not clear what you're trying to do. Are you trying to display the groupname in the groupfooter? You should just be able to drag the groupname into the gf. Or you could use your formula if it returns what you want:

If {Command.trans}[1] = "P" then
{Command.trans}

Place this in the detail section and insert a maximum on it at the group level.

-LB
 
This is the data in a table
Acct TransID Amt
5000 PO10041 2500
6000 SO10041 1500
5000 PO10041 3500
6000 SO10041 500
6000 SO10041 1000

It has to look like the display line when I am finished.
The problem is that I cannot always get the PO10041 to be captured; sometimes the S010041 will not print. It seems as though only value TransID has is the value of the last record in the detail; in this case, I would be able to print SO10041 because it is the last record in the group.

5000 PO10041 2500 6000 SO10041 1500
5000 PO10041 3500 6000 SO10041 500
6000 SO10041 1000
Display PO10041 6000 SO10041 3000



 
That's exactly how it works. This looks like a manual crosstab, so already you are using conditional formulas or running totals to get the results. Just use my earlier suggestion for the "P" text and repeat for the "S" field, or if there are always only one P value and one S value per group, then you could insert a minimum on {command.transID} and it would return the P value, while a maximum would return the S value.

-LB
 
I still do not get the correct value. When using WhilePrintingRecords, if the last record read does not begin with a P, then the value is released.

WhilePrintingRecords;
stringVar PO:= If Mid({Command.trans},1,1) = "P" then {Command.trans}


What would be the else statement for the next record when it is not a record beginning with "P"?

Using Min and Max requires a number and will not be accepted by Crystal in this case.

If there are more suggestions, I am anxious.


Carolyn
 
Your formula will not work for this. Min and Max do not require numbers. Did you try my suggestions? Any one of them should work unless your data is different than described. Maybe you should show a more extended sample.

-LB
 
I finally got your suggestion about Insert Maximum into the group footer. I guess it took a little while for me to absorb what you were trying to say. Thank you.
Carolyn
 
Just a comment: a regular crosstab inserted into the Group Footer, with columns set to {Command.trans} would provide the same information at a slightly different (more readable) layout.

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top