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

question about Running Totals

Status
Not open for further replies.

frankyberry

Programmer
Mar 15, 2007
33
US
Using CR v8.0.
On the main report I have a database field GROSS_QTY that contains a value. This main report also contains a subreport.
I would like to link this subreport to a running total variable off this GROSS_QTY value.
I also will group off this variable in the subreport

i.e if GROSS_QTY = 100, I want to have 100 different detail sections....

Here is what I have:
Code:
Shared NumberVar Cnt;

while Cnt < {VW_QTY.GROSS_QTY} do
Cnt := Cnt + 1;
Cnt


thanks!

 
I've never used 8.0, only 8.5. But if you define a running total using the Field Explorer, you should be able to pass it to the subreport using Edit > Subreport Links.

Note that this value will be posted as a select command in the subreport. Edit it if you don't want this.

As for the number of detail lines, a detail line is based on a record. You could suppress based on the value passed, if that's what you want.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
It appears that I cannot group on this value though...I would like to return data based on this running total value.

I.E
Give me data for set #1 until the set # that equals the gross QTY.


 
You could test and suppress detail lines.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks for the reply as I'm still stumped....

I'm not too sure we are on the same page.

Currently,
I have main report that contains a value in the Gross_QTY field, say 100.
The subreport is linked on a field that contains recordIDs for sets of members. I can't seem to link to a formula field or running total...
I may only have recordIDs for some of the member sets.
I would like to display a blank field for all possible memeber sets, all 100.

here is what I'm looking for:
Code:
Member ID: 1
Info: N/A
Comment:

Member ID: 2
Info: <Some Data>
Comment: <Some Data>

Member ID: 3
Info: <Some Data>
Comment:  

Member ID: 4
Info: N/A
Comment:


Currently what I am getting:
Code:
Member ID: 2
Info: <Some Data>
Comment: <Some Data>

Member ID: 3
Info: <Some Data>
Comment:

Only sets 2 & 3 have data but I want to display all.
The Gross_QTy is dynamic, not fixed at 100.
 
Crystal record selection is based on individual records. Grouping is based on individual records. That's how Crystal works: it is a report-writing tool and not a full computer language.

Detail lines and groups can be suppressed, based on fields derived from several records. That's what I was suggesting.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top