我想将值放在共享数组中并将其打印到Details部分的另一个子报表中,逐个打印数组的每个值。
我用谷歌搜索,但我似乎没有得到正确的答案。
以下是代码:
// 1st Sub Report
WhilePrintingRecords;
shared numberVar array Totdepot;
Redim preserve Totdepot[UBound(Totdepot)+1];//more space added to array.
Totdepot[UBound(Totdepot)+1]:={dtSumDe… + {dtSumDealer2.inv_depot2} + {dtSumDealer2.inv_depot3} + {dtSumDealer2.inv_depot4} + {dtSumDealer2.inv_depot5} + {dtSumDealer2.inv_depot7} + {dtSumDealer2.inv_depot6} + {dtSumDealer2.inv_depot8} + {dtSumDealer2.inv_depot9};
// 2nd Sub Report
WhilePrintingRecords;
shared numberVar array Totdepot;
Totdepot
我正在尝试打印数组的第二个值,但它仍无法正常工作。错误读取: “运行总计不能引用打印时间公式”或“公式的结果不能是数组”
答案 0 :(得分:0)
问题我
两个公式的最后一行不能是数组;把它改成类似:
// 1st Sub Report
WhilePrintingRecords;
Shared NumberVar Array Totdepot;
Redim preserve Totdepot[UBound(Totdepot)+1];//more space added to array.
Totdepot[UBound(Totdepot)+1]:={dtSumDe… + {dtSumDealer2.inv_depot2} + {dtSumDealer2.inv_depot3} + {dtSumDealer2.inv_depot4} + {dtSumDealer2.inv_depot5} + {dtSumDealer2.inv_depot7} + {dtSumDealer2.inv_depot6} + {dtSumDealer2.inv_depot8} + {dtSumDealer2.inv_depot9};
// return a dummy value to eliminate array-error message
True;
// 2nd Sub Report
WhilePrintingRecords;
Shared NumberVar Array Totdepot;
// return a dummy value to eliminate array-error message
True;
问题II
您将无法以与显示数据库记录相同的方式显示阵列; Crystal Reports不会为数组中的每个元素生成详细信息部分记录。它不是为此而设计的。
您有两种选择: