Crystal reports 如何从crystal report 8.0检索公式字段值
如何将公式字段值从Crystal reports 如何从crystal report 8.0检索公式字段值,crystal-reports,vb6,Crystal Reports,Vb6,如何将公式字段值从Crystal Report8.0检索到vb6变量 我使用了这个,但它返回空值 varValue = crxReport.FormulaFields.GetItemByName("FieldName").Value 如果您在VB6中,只需在crxReport.FormulaFields.GetItemByName(“FieldName”)上设置一个监视,并停止该行的代码 您将看到该对象,如果它被正确引用,您可以查看属性及其值1)您使用的公式必须在报告部分,否则它将不会执行,也
Crystal Report
8.0检索到vb6变量
我使用了这个,但它返回空值
varValue = crxReport.FormulaFields.GetItemByName("FieldName").Value
如果您在VB6中,只需在
crxReport.FormulaFields.GetItemByName(“FieldName”)
上设置一个监视,并停止该行的代码
您将看到该对象,如果它被正确引用,您可以查看属性及其值1)您使用的公式必须在报告部分,否则它将不会执行,也不会给出任何值。2) 然后写下这个
crxReport.FormulaFields.GetItemByName("FieldName").Value
你会得到你的答案。你在那里检索的对象的确切类型是什么?试着用
Text
替换Value
。用Text
替换Value
只返回公式本身。它总是显示varValue=“
,但如果我使用crxReport.FormulaFields.GetItemByName(“FieldName”).Text
它返回公式。这是有意义的,因为您尚未分配任何内容。停止的目的是在crxReport.FormulaFields.GetItemByName(“FieldName”)
上添加一个监视,然后当它停止时,打开+展开并查看它-FieldName
是报告字段的实际名称吗?好的。我已经在CRViewer中查看了该报告。报告从数据库中检索值,并通过公式进行计算。