Crystal reports crystal报表中局部变量和全局变量的使用
大家好,我是水晶报告的新手。我只想知道什么是Crystal reports crystal报表中局部变量和全局变量的使用,crystal-reports,Crystal Reports,大家好,我是水晶报告的新手。我只想知道什么是局部变量和全局变量。请说明局部变量和全局变量之间的区别。局部变量:顾名思义,它是所创建公式的局部变量。。。它不能在声明的公式之外使用 使用:如果要在多个公式中对变量使用相同的名称,则应使用该名称。 Along with this there is one more variable that is `Shared` it also acts as a global variable use: it is also used in resetting
局部
变量和全局
变量。请说明局部变量和全局变量之间的区别。局部变量:顾名思义,它是所创建公式的局部变量。。。它不能在声明的公式之外使用
使用:如果要在多个公式中对变量使用相同的名称,则应使用该名称。
Along with this there is one more variable that is `Shared` it also acts as a global variable
use: it is also used in resetting the value and also pass values between main report and sub report and viceversa
全局变量:可以在创建的公式范围之外使用
使用:在计算过程中,可以在报告中的任何位置将变量值重置为0,然后应使用该值。
Along with this there is one more variable that is `Shared` it also acts as a global variable
use: it is also used in resetting the value and also pass values between main report and sub report and viceversa
编辑:*********************
例如,
创建公式count
Global numbervar a;
a:=a+1;
a
现在我想在每个组发生更改时将值重置为0,然后在组标题中使用以下公式,如下所示
Global Numbervar a;
a:=0
-当前函数或公式字段local
-当前报告(不包括其子报告)全局
-当前报告及其子报告共享
a
,那么你就不能在报告中的任何其他公式中创建相同的变量a
。报告包含整个报告的公式参考。请参阅我的编辑答案。您可以尝试阅读Crystal Reports的帮助。