gpt4 book ai didi

reporting-services - Crystal Reports 公式中的错误

转载 作者:行者123 更新时间:2023-12-04 06:39:27 26 4
gpt4 key购买 nike

我有一个全局变量,它是在我文档的 Report Header 部分的公式中声明的。然后我尝试引用该变量以在 for 循环中使用它,但出现错误:

A number, currency amount, boolean, data, time, date-time, or string is expected here.



这里有什么问题,我该如何纠正?代码如下:

标题公式:
Global StringVar Array items;
redim items [1];

Global StringVar Array jobs;
redim jobs [1];

Global StringVar Array POs;
redim POs [1];

Global StringVar Array Qty;
redim Qty [1];

Global NumberVar numRecordsPrinted;
numRecordsPrinted := 0;

""

详细公式:
    Local NumberVar occurances;
Local StringVar poTOuse;
Local NumberVar i;

if {%Line_PO_Test} <> ''
and {PackingSlipHeader.CompanyCode} <> '10063'
and {PackingSlipHeader.CompanyCode} <> '10017'
then
//Count the number of occurances
For i := 0 To numRecordsPrinted Do //Error on numRecordsPrinted
(
if items[i] = {PS_DETAIL_FOR_PRINT.DTSItemNumber}
AND jobs[i] = {PS_DETAIL_FOR_PRINT.JobNumber}
And Qty[i] = {PS_DETAIL_FOR_PRINT.Quantity_Shipped}
THEN
occurances := occurances + 1
)

//Use the # of occurances to get the right PO number
Select occurances
case 0: poTOuse := {@LinePOnum}
case 1: poTOuse := {@Line_PO_3}
case 2: poTOuse := {@Line_PO_2}

default: poTOuse := "";


//Save data into the array and increment for next time
numRecordsPrinted := numRecordsPrinted + 1
items[numRecordsPrinted] := {PS_DETAIL_FOR_PRINT.DTSItemNumber}
jobs[numRecordsPrinted] := {PS_DETAIL_FOR_PRINT.JobNumber}
Qty[numRecordsPrinted] := {PS_DETAIL_FOR_PRINT.Quantity_Shipped}

//Print to the report
'PO#: ' + poTOuse;

最佳答案

当然是这一点:

    Select occurances 
case 0: poTOuse = LinePOnum
case 1: poTOuse = Line_PO_3
case 2: poTOuse = Line_PO_2

default: poTOuse = "";

应该
    Select occurances 
case 0: poTOuse := LinePOnum
case 1: poTOuse := Line_PO_3
case 2: poTOuse := Line_PO_2

default: poTOuse := "";

虽然还不清楚 LinePOnum、Line_PO_3 和 Line_PO_2 是什么。

关于reporting-services - Crystal Reports 公式中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4441704/

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