全局变量在页脚处丢失值

时间:2014-06-16 19:43:43

标签: crystal-reports global-variables

我有三个全局变量。当他们打到一个页脚时,两个人放松了它们的价值,但是另一个没有,我不明白为什么。

1组标题

2组头(所有3个全局重置)

3组标题

详细信息(未显示)

3组页脚(全局设置和显示的值 - 参见下面的函数)

2组页脚(尝试将所有变量加在一起)

1组页脚

当我尝试对2组页脚的全局变量求和时,varCccCount为零且varFishCsvcCount为零,但Varothercount保留了它的值。

有什么建议吗?


global numbervar varCccCount;

whileprintingrecords;

if left({v_EIS_EECoreCourseReq.COURSEID_I},3)="CCC" then
// this is a CCC course and I want to count it
        if isnull (Maximum ({HR2TRA04.DATE1}, {v_EIS_EECoreCourseReq.COURSEID_I}))
            then
    // this CCC course has never been taken
            varCccCount:=varCccCount
            else
    // has this CCC course expired by the cut off date of the report?
            if {@Expires}<{?Cut-off Date} then varCccCount:=varCccCount else
        varCccCount:=varCccCount+1
  // this is not a ccc course, and I do not want to increase the CCC count
  else varCccCount:=varCccCount

global numbervar varFishCsvcCount;
whileprintingrecords;

if {v_EIS_EECoreCourseReq.COURSEID_I}='FISH' OR  {v_EIS_EECoreCourseReq.COURSEID_I}='CSVC' then


 // this is a FISH or CSVC course and I want to count it

        if isnull (Maximum ({HR2TRA04.DATE1}, {v_EIS_EECoreCourseReq.COURSEID_I}))
            then
    // this CCC course has never been taken.  do not increase
            varFishCsvcCount:=varFishCsvcCount
            else
    // has this CCC course expired by the cut off date of the report?
            if {@Expires}<{?Cut-off Date} then varFishCsvcCount:=varFishCsvcCount else
        varFishCsvcCount:=varFishCsvcCount+1

  // this is not a ccc course, and I do not want to increase the CCC count
  else varFishCsvcCount:=varFishCsvcCount

global numbervar varOtherCount;
whileprintingrecords;



if not({v_EIS_EECoreCourseReq.COURSEID_I} in ['CCC1','CCC2','CCC3','FISH','CSVC'])  Then
// This is NOT a course we are already counting somewhere else, so lets take a look at it

        if isnull (Maximum ({HR2TRA04.DATE1}, {v_EIS_EECoreCourseReq.COURSEID_I})) then
    // this course has never been taken
            varOtherCount:=varOtherCount
            else
                // has this course expired by the cut off date of the report?
                        if {@Expires}<{?Cut-off Date} then varOtherCount:=varOtherCount else
                    varOtherCount:=varOtherCount+1

// This is one of the courses we are already counting in another variable.  lets not count it
else varOtherCount:=varOtherCount

0 个答案:

没有答案