我不理解水晶报告中公式中的错误
Local StringVar DistStatePin;
DistStatePin := " ";
If Not isnull({DonationByReceiptNo.place}) Then DistStatePin := DistStatePin + Space(1) + Trim({DonationByReceiptNo.place}) + ", ";
If Not isnull({DonationByReceiptNo.district}) Then
If (Mid(Trim({DonationByReceiptNo.district}),2,Length(Trim({DonationByReceiptNo.district}))-2)) <> Trim({DonationByReceiptNo.place}) Then
DistStatePin := DistStatePin + Space(1) + Trim({DonationByReceiptNo.district}) + ", ";
If Not isnull({DonationByReceiptNo.state}) Then
If Trim({DonationByReceiptNo.state}) <> Trim({DonationByReceiptNo.place}) Then
DistStatePin := DistStatePin + Space(1) + Trim({DonationByReceiptNo.state});
If Not isnull({DonationByReceiptNo.Pincode}) Then DistStatePin := DistStatePin + Space(1) + Trim({DonationByReceiptNo.Pincode});
trim(DistStatePin);
,错误是
Error in File C:\Users\Gautam\AppData\Local\Temp\temp_d5c95ff2-0ec9-458e-8a3a-bc545097fd1a {9FBD7AEE-ED90-4886-848F-262758592B77}.rpt:
Error in formula <DistState>.
'Local StringVar DistStatePin;
'
String length is less than 0 or not an integer.
答案 0 :(得分:2)
可能是这一节:
Mid( Trim({DonationByReceiptNo.district}), 2, Length(Trim({DonationByReceiptNo.district}))-2 )
为了清晰起见而进行了重构:
Local Stringvar district:=Trim({DonationByReceiptNo.district});
Mid( district, 2, Length(district)-2 );
如果district=""
那么您的公式将是Mid( "", 2, 0-2 )
,这会给您一个错误。