×
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

Store and Fetch!!!!!!!

Store and Fetch!!!!!!!

Store and Fetch!!!!!!!

(OP)
If anyone could help me it would be greatly appreciated.  I am using crystal version 6 and I am trying to pass information from a subreport to the main report.  I have set up three formulas:
1)Grand total main:----I placed this formula in main report above subreport(GH)

whileprintingrecords;
storenumbervar ("x", 0)

2)Grand Total Store:---placed this in the subreport
whileprintingrecords;
storenumbervar("x", Sum ({CLFU$M$S$00000007T.CURASSET}))

3)Fetch Grand Total--placed this in the main report
whileprintingrecords;
fetchnumbervar("x");

I need the formulas to store the sum for each record and display the total.  However, the formula is only displaying the sum of the last value.  How do I make it store all the values and then display the total of all values.  I understand why it is giving me this value but I don't know how to modify the second formula.

RE: Store and Fetch!!!!!!!

The first formula is irrelevant, you can delete it.

For the second and third, tell us which section of the report the formula is in.

Also:

>>the formula is only displaying the sum of >>the last value.  

Which formula?
Last value of which report?

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: Store and Fetch!!!!!!!

Salvatoref: I think you have not understood the use of the store and fetch process. Storenumbervar will store the value you choose with whatever frequency the section you place it in will print i.e. if you put it in the report header/footer only once, if you put it in the details once per record. The same with fetch.

It seems to me that what you need to do is accumulate the value you are selecting CURASSETS within your subreport e.g. use a variable C_ASSETS as follows:

numbervar c_assets := c_assets+CURASSETS

and then store the end result of this accumulation before fetching it in the main report

David C. Monks
david.monks@chase-international.com
http://www.chase-international.com
Accredited Crystal Decisions Enterprise Partner

RE: Store and Fetch!!!!!!!

dcm,

Since he stored the grand total of the subreport, he shouldn't need accumulation.

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: Store and Fetch!!!!!!!

(OP)
Hi Ken,

The second formula, Grand Total Store was placed in group Header one of the subreport.  The thrid formula Fetch grand total was placed in the main report under group footer 1.  

When I say the sum of the last value what I am referring to is this:
I have created a subreport that calculates the current assets based on representatives from the main report.  This subreport report is working correctly as it is summing all assets per representative name and displaying them.  However, the store and fetch formula(mainly the fetch in the main report) is picking up that last value for the last representative, it is not subtotalling all representatives current assets.  Hopefully this is clear. ie. its like saying 1+2+3+4+5 and the only value the report is picking up is the 5 not the total of all numbers(15). It is the last value of the subreport(current assests). Thanks Ken

RE: Store and Fetch!!!!!!!

Ah, I see.  The subreport is for EACH representative separately.  This means that each time the subreport runs you will store one total, simply replacing one total with another each time you store.  When you finally fetch, you will only fetch the last one stored.

You will need to create another variable in the main report and do a running total as suggested by dcm.  This should use the value that is fetched and add it to the accumulating total at the same frequency as the fetch.  See the FAQ on running totals for the 3-formula technique if you need more help.  

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

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