Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/crystal-reports/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Crystal reports 如何从crystal report 8.0检索公式字段值_Crystal Reports_Vb6 - Fatal编程技术网

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中查看了该报告。报告从数据库中检索值,并通过公式进行计算。