“此字段名称未知”错误(晶体报告) [英] 'This field name is not known' error (Crystal Reports)

查看:63
本文介绍了“此字段名称未知”错误(晶体报告)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我遇到的一个奇怪问题。

Here is a strange problem I have run into.

我的记录选择公式如下,出于这个错误,我将其简化了:

My record select formula is as follows, I have dumbed it down for purposes of this error:

reportDocument.RecordSelectionFormula = " {@ClientName} = 'Smith' "

如果我将此精确选择语句复制到Crystal中,则可以预览,但是从.NET运行时,我得到

If I copy this exact selection statement into Crystal it previews fine, but when run from .NET I get


此字段名称未知。

'This field name is not known'.

问题出现在 @ClientName 公式字段。

@ClientName 仅包含:

formula = {aw_illust.CL1LNAM}

我也可以将其设置为空白字符串(公式=),它仍然给出

I can also set it to just a blank string (formula = "") and it still gives


'此字段名称未知。'

'This field name is not known.'

这是奇怪的部分,如果我绕过公式并将公式文本直接放入.NET,一切正常。

Here is the strange part, if I bypass the formula and put the formula text straight into .NET everything works fine.

reportDocument.RecordSelectionFormula = " {aw_illust.CL1LNAM} = 'Smith' "

那是相同的记录选择,除了用 {aw_illust.CL1LNAM}代替的 @ClientName 公式。它仅发生在此报告上,我还有许多其他的Crystal Reports使用.NET中引用的公式就可以了。有任何想法吗?

That is the same record selection, except with the '@ClientName' formula replaced with '{aw_illust.CL1LNAM}'. It just happens on this one report, I have many other Crystal Reports working with formulas referenced in .NET just fine. Any ideas?

推荐答案

您很可能没有在报表中的任何地方使用{@ClientName}公式; Crystal Reports倾向于忽略未使用的字段,公式等。将{@ClientName}字段放在报表中的某个位置(标题或某些类似的部分)并加以抑制-这样,您就不会弄乱报表设计,但是CR随后应该知道该公式

Most likely you are not using your {@ClientName} formula anywhere on report; Crystal Reports tends to ignore unused fields, formulas etc. Place {@ClientName} field somewhere in report (header or some similar section) and suppress it - this way you don't mess up report design, but CR should know about that formula afterwards.

这篇关于“此字段名称未知”错误(晶体报告)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆