Crystal Reports - “此处需要一个字符串” 公式错误

发布于 2024-07-29 08:56:29 字数 917 浏览 3 评论 0原文

我有一个命令行实用程序,可以生成一份简单的水晶报告。 我最近使用 Visual Studio 2008 迁移器将项目从 .NET 1.1 更新到 .NET 3.5,现在收到了以前从未收到过的错误。

问题出在 work_order 公式中,如下所示:

stringVar nvl_ship_wrk_id := "0";
stringVar nvl_ship_wrk_seq := "0";

If Not IsNull({FeedBOLInput.ShipWrkId}) Then 
    nvl_ship_wrk_id := {FeedBOLInput.ShipWrkId}; 

If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then 
    nvl_ship_wrk_seq := {FeedBOLInput.ShipWrkSeq};

nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq;

错误是:

- InnerException    {"A string is required here.
Error in File C:\\...\\temp_88c50533-02c6-4973-ae06-ed0ab1a603ac {0D5E96FB-038A-41C5-93A7-A9D199961377}.rpt:
Error in formula  <work_order>. 
'stringVar nvl_ship_wrk_id := \"0\";
'
A string is required here."}    System.Exception {System.Runtime.InteropServices.COMException}

有谁知道这可能是什么? 我没有线索了。 数据集正确输入 - 并且错误似乎指向仅初始化变量的行。

I have a command line utility that generates one simple crystal report. I recently updated the project from .NET 1.1 to .NET 3.5 using the Visual Studio 2008 migrator and am now getting an error that I had never received before.

The problem is in the work_order formula which is as follows:

stringVar nvl_ship_wrk_id := "0";
stringVar nvl_ship_wrk_seq := "0";

If Not IsNull({FeedBOLInput.ShipWrkId}) Then 
    nvl_ship_wrk_id := {FeedBOLInput.ShipWrkId}; 

If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then 
    nvl_ship_wrk_seq := {FeedBOLInput.ShipWrkSeq};

nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq;

And the error is:

- InnerException    {"A string is required here.
Error in File C:\\...\\temp_88c50533-02c6-4973-ae06-ed0ab1a603ac {0D5E96FB-038A-41C5-93A7-A9D199961377}.rpt:
Error in formula  <work_order>. 
'stringVar nvl_ship_wrk_id := \"0\";
'
A string is required here."}    System.Exception {System.Runtime.InteropServices.COMException}

Does anyone have any idea what this can be? I'm out of clues. The dataset is coming in properly - and the error seems to point to a row which merely initializes a variable.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长伴 2024-08-05 08:56:29

您可以尝试将 {FeedBOLInput.ShipWrkId} 和 {FeedBOLInput.ShipWrkSeq} 转换为字符串,以确保它作为字符串出现。

我不确定为什么你所拥有的不起作用,但看看下面的内容是否适合你。

stringVar nvl_ship_wrk_id := "0";
stringVar nvl_ship_wrk_seq := "0";

If Not IsNull({FeedBOLInput.ShipWrkId}) Then 
    nvl_ship_wrk_id := CStr({FeedBOLInput.ShipWrkId}); 

If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then 
    nvl_ship_wrk_seq := CStr({FeedBOLInput.ShipWrkSeq});

nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq;

You can try to cast the {FeedBOLInput.ShipWrkId} and {FeedBOLInput.ShipWrkSeq} to a string to make sure that it is coming across as a string.

I'm not sure why what you have wouldn't work, but see if the below works for you.

stringVar nvl_ship_wrk_id := "0";
stringVar nvl_ship_wrk_seq := "0";

If Not IsNull({FeedBOLInput.ShipWrkId}) Then 
    nvl_ship_wrk_id := CStr({FeedBOLInput.ShipWrkId}); 

If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then 
    nvl_ship_wrk_seq := CStr({FeedBOLInput.ShipWrkSeq});

nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文