公式字段显示空白而不是所需的结果
我陷入了水晶报表中公式字段的问题,并且一直在原地打转。我会尽力解释它。
我正在创建的报告将导出为数据文件。它使用 3 个表,其中 work_table
作为主表。 work_table
使用两个字段 orderhdr_id
和 order_item_seq
连接到名为 order_item_with_aux
的视图;这是一个内部连接。我认为这对我的问题没有太大影响,但是,work_table
也加入到customer_id
和customer_address_seq上的
。customer_address
表
在我的输出中,我包含了所有三个表中的几个字段。我陷入困境的是创建一个公式字段来填充 @Split
字段。以下是我在公式中编写的内容:
if {order_item_with_aux.zzaux_no_renewal_notices} = "Y" then "B"
else {work_table.split_value}
这会导致 @Split
字段在 work_table
上的记录中填充“B”,而该记录在 work_table
上order_item_with_aux 视图的 zzaux_no_renewal_notices
等于“Y”。显示的所有其他记录的 @Split
值为空。我已经尝试了上述公式的几种变体,但均无济于事。我也尝试过设置一个变量并以这种方式处理它,但同样不行。
有人有什么想法吗?如果我可以提供更多信息,请告诉我。
I'm stuck on a problem with a formula field in Crystal Reports and I keep going around in circles. I'll try my best to explain it.
The report I'm creating will be exported as a data file. It uses 3 tables, with work_table
as the main table. work_table
is joined to a view called order_item_with_aux
using two fields, orderhdr_id
and order_item_seq
; it's an inner join. I don't think this has much bearing on my problem but, work_table
is also joined to the customer_address
table on customer_id
and customer_address_seq
.
In my output, I've included several fields from all three tables. Where I'm stuck is creating a formula field to populate a @Split
field. Here's what I'm writing in my formula:
if {order_item_with_aux.zzaux_no_renewal_notices} = "Y" then "B"
else {work_table.split_value}
This results in the @Split
field being populated with "B" for records on the work_table
whose corresponding record on the order_item_with_aux
view has zzaux_no_renewal_notices
equal to "Y". The value of @Split
for all other records displayed is blank. I've tried several variations of the above formula all to no avail. I've also tried setting a variable and handling it that way, but again, no go.
Anyone have any ideas? Please let me know if there's more info I can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先测试空值:
You need to test for null values first: