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

reseting passed subreport variable in main report 1

Status
Not open for further replies.

lauriesamh

Technical User
Sep 1, 2004
119
US
Hi, I'm using CR10 and have a report with a subreport. Both reports are grouped by person ID and I want to pass a variable from the subreport when the person ID's match. I have linked the main to the subreport by person ID and the variable is passing. The issue is the passed variable doesn't appear to reset. Any help is very much appreciated.

Here is the report setup.
GHeader#1 (person ID) contains a reset formula {@reset}

@reset
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

GFooter#1 (person ID) - contains subreport

GFooter#1b has the passed variable {@membervisit}

@membervisit
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

 
How is your subreport linked to the main report.

If you link subreport to main report by PERSONID there will be no need to pass a variable. If SR is then located in PERSONID group on main report it will only bring back data for that person.

Ian
 
Hi, I have linked by the PersonID. I want to use the variable to do a calculation in the report footer to compare total Persons in the main report to # of members having a visit.
 
Where is the variable MemberPCPVisit evaluated.

Please show formula and where located.

Ian
 
Ian,
Group #1 is by personID
GFooter#1b has the passed variable {@membervisit}
The MemberPCPVIsit is evaluated in the GFooter #1c with the formula {@count member with PCP visit}

{@count member with PCP visit}
if {@Member with PCP Visit}>0 then 1 else 0
 
Laurie

Sorry when I said where is MemberPCPVisit evaluated. I meant where is it given its value and whatis the formula that gives it its value.

What do you intend to do with

{@count member with PCP visit}
if {@Member with PCP Visit}>0 then 1 else 0

You will not be able to summarise this. You will need another variable to increment as a count.

Still not sure what you are trying to do, can you give an example of sort of data you will generate.

Ian
 
Ian,
My goal is to identify persons via the subreport who have visits within the main report of all persons. I then need to create crosstabs in the main report footer segregating the people by different demographic ways AGE; Gender; etc... and show total # persons and # persons with visits for comparisons. Problem is after a person with a visit is idenified the formula identifing the person in the main report doesn't reset. I appreciate your assistance!
Here is the entire setup below.

The subreport identifies people with visits and is grouped by person id. The formula in the subreport at the personID group #1

@personwvisit
whileprintingrecords;
shared numbervar MemberPCPVist;
MemberPCPVist:= Sum ({@Claim Provider = PCP?}, {CMCV_SBSB_BASE.SBSB_ID})

In the main report
The report setup.
GHeader#1 (person ID) contains a reset formula {@reset}

@reset
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

GFooter#1 (person ID) - contains subreport

GFooter#1b has the passed variable {@membervisit}

@membervisit
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

The MemberPCPVIsit is evaluated in the GFooter #1c with the formula {@count member with PCP visit}

{@count member with PCP visit}
if {@Member with PCP Visit}>0 then 1 else 0
 
I would move the reset into the Group header of te sub report.

YOu seem to be resetting MemberPCPVisit to zero in

in
GFooter#1b

@membervisit
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

So when it gets to GF1c it will be zero.

Ian
 
Okay I tried this. Now once a person is identified as having a visit it populates a "1" but after that person the next person doesn't have a visit but it shows as 1. Ideas?

GH1 has the reset
WhilePrintingRecords;
shared NumberVar MemberPCPVisit:=0;

GF1a has the subreport
GF1b has the passed variable
GF1c has the determination in the main report of the visit for the person.
{@count member with PCP visit}
if {@Member with PCP Visit}>0 then 1 else 0

 
Try moving reset to report header of the subreport.
If there are no visitors then GH1 has no data so var will not evaluate.

Ian
 
Ian,
I got it figured out. Just rearranged one field. Thanks so much and hope the rest of your workweek is good and very quick.
Thanks,
L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top