Link to home
Start Free TrialLog in
Avatar of michaelleffew
michaelleffew

asked on

How to print subtotal in body of report, based on last occurance of item number

Hello,

I use Dynamics GP 10, and Crystal Reports 2008 to print my sales documents (via Forms Printer from Accountable Software).  I'd like to be able to print a subtotal in the body of the sales quote form, based on the last occurance of a certain item number.

For example, I have a large quote that references several areas of a building.  I would like to show a subtotal for each area.  The last line item in each area is a part number called "ROOM".  This part number signifies the end of the equipment for that room.

Any help you can provide is greatly appreciated!
Avatar of pssandhu
pssandhu
Flag of Canada image

Do you have area numbers, ids or some kind of unique key value for each area. I would use that field to group my report and add a subtotal in that group.
However, from your explanation it does not seems that way. From top my head (not tested) I am think of having a unique identifier for each group. So to accompalish that you can have something like this:
1. Create a formula and call it what ever you want and put this text in there:
WhilePrintingRecords;
Shared Numbervar val;
IF {Table.PartNumberField} <> "ROOM" Then val
ELSE val := val+1;
val
2. Place the formula in your detail section and create a group using this formula.
3. This formual should create an incrementing unique id for each group and should group each area. Add your subtotal to this group.
Hope this helps.
P.
Avatar of Mike McCracken
Mike McCracken

You can't group on printtime formulas like that since they are calculated after grouping is done.

Try this.

Put the subtotal on the report.
Right click it
Click FORMAT OBJECT
Click the COMMON TAB
Click the FORMULA button to the right of SUPPRESS
{Your Field} = "Room"

If you are trying to do a subtotal for just that room it may require other formulas.

mlmcc
Avatar of michaelleffew

ASKER

Thanks for your feedback!  I am trying to do a subtotal for just that room.  I would need subtotal to show at the end of each room.  Each quote has several rooms in it.
so, i was playing around with the running total field suggested by mlmcc, and got it to look pretty good, with one exception...  I've told it to reset the total based on the item number "ROOM".  Now, the total shows 0.00.  Is there a way to tell it to reset after the item number "ROOM" ?

Thanks for your continued help!!
Can you not declare a local variable, assign the value to the local variable, reset the total and print the local variable.
P.
i'm afraid I don't follow :(
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
Thank you for your help!!