Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.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
Reporting services Reporting services,文本框消息_Reporting Services_Reportingservices 2005 - Fatal编程技术网

Reporting services Reporting services,文本框消息

Reporting services Reporting services,文本框消息,reporting-services,reportingservices-2005,Reporting Services,Reportingservices 2005,我正在使用SQLServerReportingServices2005 我有一个带有数据集的报表,该数据集从SQL Server数据库获取数据。此外,我还有两个类型为DateTime(StartDate\u param和EndDate\u param)的报告参数,用户可以在报告中选择它们 我设置了一个限制,如果用户选择不同月份的日期,例如6月1日和5月3日,则流程停止: 我在报告属性------代码部分有以下代码来管理限制: Public Function ValidateDate(StartD

我正在使用SQLServerReportingServices2005

我有一个带有数据集的报表,该数据集从SQL Server数据库获取数据。此外,我还有两个类型为
DateTime
StartDate\u param
EndDate\u param
)的报告参数,用户可以在报告中选择它们

我设置了一个限制,如果用户选择不同月份的日期,例如6月1日和5月3日,则流程停止:

我在报告属性------代码部分有以下代码来管理限制:

Public Function ValidateDate(StartDate As DateTime, EndDate As DateTime) As DateTime

  If (DateDiff(DateInterval.Month, StartDate, EndDate) <> 0) Then

      Err.Raise(6,Report)

  End If

End Function
这将停止SQL处理,并且在输入不同月份的日期时出现此错误:

处理“CheckDateRange”报表参数时出错

但是我想在文本框上显示一条消息,而不是现在显示的消息,我该怎么做

如果不可能的话,我该怎么办


谢谢..

与其停止进程,不如向用户显示不同的“报告”。此错误报告将包含您希望向用户显示的错误消息。然后,您只需根据参数的评估设置报表的条件可见性,还可以更改“实际”报表的SQL,以便在用户给出错误参数时它甚至不会运行(这将防止进行现在无用的查询,因为不会显示此数据)

因此,如果您的报告现在是tablix,请在给定错误参数时将tablix的可见性条件设置为隐藏。然后在tablix外部创建一个文本框,用于存储错误消息,并为其提供相反的可见性条件逻辑。然后更改SQL查询,使其在给定错误参数时只返回空行

= Code.ValidateDate(Parameters!StartDate_param .Value, Parameters!EndDate_param .Value)