gpt4 book ai didi

crystal-reports - Crystal 报表中的全局变量

转载 作者:行者123 更新时间:2023-12-02 17:51:18 25 4
gpt4 key购买 nike

我试图在 Crystal Reports 中保持教师、支持人员和经理的运行总数,我决定使用全局变量来做到这一点,我知道可以通过其他方式实现,但我想提供全局变量变量一个去。

    WhileReadingRecords;
Global NumberVar TotalSManagement;
Global NumberVar TotalSTeachers;
Global NumberVar TotalSSupport;
Global NumberVar TotalLManagement;
Global NumberVar TotalLTeachers;
Global NumberVar TotalLSupport;

if{staff_addresses_txt.Staff category} = "MANA" and {staff_addresses_txt.Name} = "CTK:Lewisham" then
TotalLManagement = TotalLManagement + 1
else
if{staff_addresses_txt.Staff category} = "TEAC" and {staff_addresses_txt.Name} = "CTK:Lewisham" then
TotalLTeachers = TotalLTeachers + 1
else
if{staff_addresses_txt.Staff category} = "SUPP" and {staff_addresses_txt.Name} = "CTK:Lewisham" then
TotalLSupport = TotalLSupport + 1
else
if{staff_addresses_txt.Staff category} = "MANA" and {staff_addresses_txt.Name} = "CTK:St Mary's" then
TotalSManagement = TotalSManagement + 1
else
if{staff_addresses_txt.Staff category} = "TEAC" and {staff_addresses_txt.Name} = "CTK:St Mary's" then
TotalSTeachers = TotalSTeachers + 1
else
if{staff_addresses_txt.Staff category} = "SUPP" and {staff_addresses_txt.Name} = "CTK:St Mary's" then
TotalLSupport = TotalLSupport + 1;

if 语句肯定会触发,但是当我使用以下代码在页面底部显示总计时,一切都是 0.00:

Global NumberVar TotalSManagement;
Global NumberVar TotalSTeachers;
Global NumberVar TotalSSupport;
Global NumberVar TotalLManagement;
Global NumberVar TotalLTeachers;
Global NumberVar TotalLSupport;

if {staff_addresses_txt.Name} = "CTK:Lewisham" then
"[Lewisham] Managers: " & TotalLManagement & " | Teachers: " & TotalLTeachers & " | Support: " & TotalLSupport
else
"[Sidcup] Managers: " & TotalSManagement & " | Teachers: " & TotalSTeachers & " | Support: " & TotalSSupport

制作这个: [Lewisham] 经理:0.00 |教师:0.00 |支撑:0.00

我是否错误地使用了全局变量?我试过用其他数字初始化它们,但响应总是一样的。有什么想法吗?

最佳答案

您永远不会为变量分配任何值。 “:=”是赋值运算符,不是“=”。另外,为了安全起见,页脚公式应该有 WhilePrintingRecords;在顶部。

关于crystal-reports - Crystal 报表中的全局变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7673897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com