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

Shared Variables 1

Status
Not open for further replies.

LLowrance

Programmer
May 11, 2004
47
0
0
US
I think I've read every thread regarding Shared Variables and can't find the answer to what I'm sure isn't a unique situation. I'm using CR 8.5 ODBC to SQL database. (someone please tell my company to upgrade to XI!!)

I have a main report that has claim data. Each claim can have multiple active periods that have begin and end dates. This tracks when a claim was open and closed and what type it was (med only or Lost time). There are two groups, by claim office and then by claim #. I'm counting the number of active periods per claim, and also the number of claims per claim office. The subreport is retrieve some billing information (sum(increments) and sum($ amount) for each claim & claim office. The subreport summaries by claim# are working fine. I need the increment & amount sums by claim office as well as grand totals to appear in the main report. The subreport is linked by claim# and chargedate which is a prompt from the main report. The only thing not suppressed in the subreport is the GF2. I'm getting zeros for my shared variables. Can you not suppress the GF1,GF2,RFa,RFb? Is what I'm trying to do even possible? If I can the shared variables to work, I would also like to use them in formulas in the main report, report footer.

Structure looks like this:

Main Report:
Formula for Shared Variables:
@SHVI
WhilePrintingRecords;
Shared NumberVar I;
I
@SHVA
WhilePrintingRecords;
Shared CurrencyVar A;
A
@SHVIGT
WhilePrintingRecords;
Shared NumberVar IGT;
IGT
@SHVAGT
WhilePrintingRecords;
Shared CurrencyVar AGT;
AGT

GH1-Claim office
GH2-Claim #
Detail - active period information
GF2-Claim # (count of active periods) (subreport located here)
GF1-Claim Office (Distinct count of claims) @SHVI @SHVA
RF - Distinct Count of Claims @SHVIGT @SHVAGT

Subreport:
Formuala for Shared Variables:
@SharedV
WhilePrintingRecords;
Shared NumberVar I := Sum(increments)by Claim office;
Shared CurrencyVar A := Sum(amount) by Claim Office;
Shared NumberVar IGT := Sum(increments);
Shared CurrencyVar AGT := S(amount);

GH1-Claim office
GH2-Claim #
Detail - increments amount
GF2-Claim # sum(increments) sum(amount)
GF1-Claim Office sum(increments) sum(amount)
RFa - Sum(increments) sum(amount)
RFb - @SharedV

I've tried to include everything, thanks for your help.


-LLL
 
You cannot suppress the section that a subreport is located in. You could suppress all sections within a subreport and the values would still pass, although you cannot suppress the subreport as a whole object.

Note that the subreport will only return values at the claim# level. Once you have that value stored in a shared variable, you can reference it in a section below the subreport, but in the same group, i.e., in GF2_b. You then must increment the shared variable in two other variables in the main report, one for the group #1 summary, and one for the grand total. You need to add reset formulas in the main report also, one in the GH#2 to reset the shared variable per claim# (in cases of nulls), and on in GH#1 to reset the group summary.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top