如何判断参数是否已链接? [英] How to tell if a parameter is linked?
问题描述
我正在尝试自动运行许多报告。我这样做是通过运行报告列表和提示(使用查看器)并保存输入的参数值以便稍后运行。
我在设置一些参数值时遇到问题。我知道我不必设置链接的子报表参数值(因为它的值将从链接传递)。但是,我无法判断参数是否已链接?
这里是反射器中的 CrystalDecisions.CrystalReports.Engine .ParameterFieldDefinition.IsLinked属性...
Public 可覆盖 功能 IsLinked ( ) As 布尔值
I'm trying to automate the running of many reports. I do this by running a list of reports and prompting (with the viewer) and saving the entered parameter values to be run later.
I'm having issues setting some parameter values. I know I don't have to set a linked subreport parameter value (as it's value will be passed from the link). But, I cannot tell if a parameter is linked or not?
Here's the CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition.IsLinked property in reflector...
Public Overridable Function IsLinked() As Boolean
Return False
End Function
所以甚至没有实现。
这是一个问题,因为我不知道是否需要提示参数。无论如何都要找出参数是如何链接的?也许在reportobjects集合中的某个地方?
感谢您的阅读。
so that's not even implemented.
This is a problem, since I cannot tell if I need to prompt for parameters. Is there anyway to find out how parameters are linked? Maybe somewhere in the reportobjects collection?
Thanks for reading.
推荐答案
首先,我检查所有参数是否都有值。由于我无法判断它们是否都需要值,我的第二个测试是尝试导出报告。如果失败,则需要提示。不理想,但它确实有效。
想想看,我相信CRV知道如何提示需要。如果您处理CRV错误事件,您将注意到触发了ParameterFieldMissingValueException,然后显示提示。
First, I check if all parameters have a value. Since I cannot tell if they all need a value my second test is to try to export the report. If that fails, then prompting is needed. Not ideal, but it works.
Come to think of it, I believe that's how the CRV knows a prompt is needed. If you handle the CRV error event you will notice the ParameterFieldMissingValueException is fired and then the prompt is displayed.
这篇关于如何判断参数是否已链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!