Link to home
Start Free TrialLog in
Avatar of Erin Leale
Erin LealeFlag for United States of America

asked on

Crystal Reports - Display Last Invoice in Group

Good morning:

I have a report that is grouped by Customer then Invoice.  I want to show the last invoice in my data selection - the invoice details are in the details section.  What is the best way to make this happen?  I have tried using a running total and only displaying the Maximum record but Crystal is not liking that.

Thank you.
Avatar of Lee Ingalls
Lee Ingalls
Flag of United States of America image

Try the formula OnLastRecord{field name} in the detail section.
Avatar of Erin Leale

ASKER

I went into the Details Section and attempted to add the formula - it gave me an error "to many arguments for this function"
Simplify it a little bit. I took one of my invoice reports to demonstrate.
Right click the Details section in design view
Select Section Expert
Select Details
Click the X-2 icon next to Suppress
In the formula workshop - format formula editor type:  Not OnLastRecord
Select Save and Close
OnLastRecord.jpg
When I do that - I get the last record for the entire report.
C--Erin-Leale-Exports-for-Joe-Exampl.jpg
So you want to see the LastRecord for each Customer GROUP?
Avatar of Mike McCracken
Mike McCracken

If you want to see the last invoice for a customer, drop the information into the Customer Group Footer.

mlmcc
I agree with mlmcc.  The obvious solution would seem to be to put the fields in the customer group footer.  Then you'll get the values from the last record in the group (ie. the last invoice).  If you want to see _only_ the last invoice, you can suppress the detail section.  Of course any CR summaries will still include the other invoices, since they're only being suppressed.

 If that doesn't give you what you need, can you provide some more details about what you're trying to do?

 James
I have shared variables in the report on the details line - if I move the data to the Group Footer I break the shared information.  I will have to play with the sections and see if I can move my shared information to get it to work with the group footer.  

Thanks.
Where is the subreport?

DO you need totals of the shared variables or just the last value?

How are you displaying the shared values?

mlmcc
The subreport is in a group Detail a and my Details are in Details b.  

No totals for the Shared Variables.  They are passing Freight Rates and Inventory Price Tables to the Invoice detail line.

I'm using a formula to display the Shared Variables.

Thanks.
When you say that you "break the shared information", what exactly do you mean?  Are the variables "empty", or do they have the values from another record, or ...?

 Are you resetting/changing the shared variables in Details B or in the group footer (either in the main report or in another subreport)?  If not, the values from the last detail record should still be there in the group footer.

 James
They are empty.  I have a reset in the Group Header appropriate for the variable data.  

I can see if it is possible to scrub the data enough to put an example report out here - however - if I can't be done then it can't be done.

Thanks!
You could post the report file without data.  Then at least we could see your formulas, etc.

 James
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!