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

SCOPE How can i get it to work 2

Status
Not open for further replies.

EFREE

Programmer
Jun 29, 2005
41
US
I want to make a running total on my report to total the amount of sales for each agent by project. I have it grouped by project (group 1) and then by agent (group 2). I am printing each record in the details section and then want to have a sub total at the end of each agents sales in the group 2 footer. The code there right now looks as follows:

=RunningValue(Fields!PromisedToPayAmt.Value,SUM,???)

The ??? is supposed to be the scope but anything i put in there doesnt work including group 2, agent, or if i omit it. If i put 'nothing' in there it works but doesnt reset after each agent.
 
Are you sure you want RunningValue? If you just want a Subtotal for each agent you would just want "=SUM(Fields!PromisedToPayAmt.Value)" in the agent footer.
 
See i tried that, and it just gives me the total for the whole report. I thought running totals would be good because then it would just reset after each agent.

But what exactly is scope anyway. I got the help files loaded and it just says it is an aggrigate function, but gives no examples.
 
So if I understand correctly, you are saying that you do have SUM in the agent's group footer but see the entire total? So the same total is repeating itself under each agent's listing? That is odd... I wonder if you have some grouping issues or errors, or something nested incorrectly. I don't know.

Scope just clarifies certain functions. For example, if you have two datasets, sometimes you need to specify the "scope", or dataset that the field is coming from. In the case of RunningValue, however, Scope refers to what grouping that the RunningValue is valid over and when it should reset. For example, if you had

=RunningValue(Fields!PromisedToPayAmt.Value,SUM,"Project")

then the Value would continue to accumulate pay amounts for each record regardless of agent until you hit the end of the entire project... at which time it would reset to zero for the next project. If you had

=RunningValue(Fields!PromisedToPayAmt.Value,SUM,"Agent")

then it would accumulate payments for each record under the specific agent, but reset when you hit a new agent. (note the quotes around the group name).

Still, I think SUM is what you want. We just need to figure out your grouping issues. Perhaps try just a single group level for now... like remove Agent and just try having it grouped by Project only to start with. See how the SUM works in the footer in that case.
 
ookete, you really know your stuff. I thought knowing crystal would let me pick this up in three days but that seems not the case.
 
ookete, you really know your stuff. Thanks! ... I thought knowing crystal would let me pick this up in three days but that seems not the case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top