×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

help with summing whileprintingrecords

help with summing whileprintingrecords

help with summing whileprintingrecords

(OP)
Hi
Quite new to crystal and need to get a sum in an existing report but need some help?

Have this in GH2
WhilePrintingRecords;
numbervar RunPhysical;
RunPhysical:= {STK_STOCK.STK_PHYSICAL} + {STK_STOCK.STK_QTYPRINTED}

Have this in Details
Whileprintingrecords;
Numbervar RunPhysical;
If {STK_MOVEMENTS.SM_DATE} > {?Report Date} And {STK_MOVEMENTS.SM_STATUS} = 'I'
Then
(if {STK_MOVEMENTS.SM_SERIALTRACK}=1 then
RunPhysical := RunPhysical - 1
else
RunPhysical := RunPhysical - ({STK_MOVEMENTS.SM_QUANTITY}*{STK_MOVEMENTS.SM_QTYUNIT})
)
Else
If {STK_MOVEMENTS.SM_DATE} > {?Report Date} And {STK_MOVEMENTS.SM_STATUS} = 'O'
Then
(if {STK_MOVEMENTS.SM_SERIALTRACK}=1 then
RunPhysical := RunPhysical + 1
else
RunPhysical := RunPhysical + ({STK_MOVEMENTS.SM_QUANTITY}*{STK_MOVEMENTS.SM_QTYUNIT})
)
Else
RunPhysical := RunPhysical




Have this in GF2
whileprintingrecords;
numbervar RunPhysical;


I have totals being generated in the GF2 but need the sum of these in GH1 - is there a way to do this?
Really sorry if anyone needs more info, as I say, im new to CR
Many thanks

RE: help with summing whileprintingrecords

You can not put WhileprintingRecords var totals in Group Headers.

If you want them to appear in GH you must add a Subreport and then pass a Shared Var to the Group Header. You can make Subreport very thin and you can hide all fields in SR so that it does not impact report layout. But you can not hide in a suppressed section, you can make it very thin and then get the section holding the SR to underlay and this reduces impact even further.

Ian

RE: help with summing whileprintingrecords

(OP)
Ok and thanks for the reply, however not quite sure how to start here - any pointers?

RE: help with summing whileprintingrecords

Can you explain why you are using variables? What fields are you grouping on? What happens if you remove the variables and just use a conditional formula and then insert summaries on it at various group levels?

-LB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close