Sharing Variables between Crystal Report and sub-report 
Author Message
 Sharing Variables between Crystal Report and sub-report

I'm using Crystal Reports 8.5 on Win 2K Pro, and I need to share
variables between my report and subreport.

In my report, here's my formula to populate the variables:
select {accounting_info;1.type} [1 to 20]
    case "AVG.WAGE.RATE" : shared numbervar AveWageRate :=
{accounting_info;1.Current Year Budget}
    case "SAL.EXP.UNIT2" : shared numbervar SalExp :=
{accounting_info;1.Current Year Budget}
    case "SUP.EXP.UNIT2" : shared numbervar SupExp :=
{accounting_info;1.Current Year Budget}
    case "TOTEXP.UNITUOS2" : shared numbervar TotExp :=
{accounting_info;1.Current Year Budget}
    case "TOTHRS.UNITUOS2" : shared numbervar TotHrs :=
{accounting_info;1.Current Year Budget}
    ;

I'm using this method because of the way my data comes over.  The
problem is, for many departments, I have no SUP.EXP.UNIT2,
TOTEXP.UNITUOS2, or TOTHRS.UNITUOS2.  In these instances, the case
doesn't run for that variable, and it gets the variable from the
previous department.

Is there anyway to initilize these variables?  I've tried adding the
following to the top of the formula:
shared numbervar TotHrs := 0;
shared numbervar TotExp := 0;
shared numbervar SupExp := 0; -- and so on

But then it just passes a zero to the subreport.  I guess my question
is can I initilize these in one formula and have it run first?  Is
there a Formula execute order someplace?

Thanks for any advice.  

Keegan



Sat, 16 Jul 2005 22:47:28 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. vb5 Crystal Reports 6 and Subreports Can we conditionally call subreports from primary reports

2. REports and sub-reports in Crystal Reports

3. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

4. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

5. How to pass the shared variables from subreport to main report (urgent)

6. Crystal Reports Shared Variables

7. passing variables from report to a sub report

8. Crystal Reports - Main/Sub Reports

9. Crystal Reports, sub-report question

10. Q: Pass a SQL query from VB to crystal report sub-report

11. sub-report (2 query's ) in crystal reports

12. Crystal not saving sub report data with report

 

 
Powered by phpBB® Forum Software