简体   繁体   English

如何通过URL将日期参数传递给2005 SSRS报告

[英]How to pass a date parameter to 2005 SSRS report through URL

I am trying to create a URL link for a report and pass in a date parameter. 我正在尝试为报表创建URL链接并传入日期参数​​。

The report has an InDate parameter that maps to a dropdown populated by a SQL query. 该报告具有InDate参数,该参数映射到由SQL查询填充的下拉列表。 The query returns a datetime (value) and an expression (label) that outputs the date value in a {month} - {year} format. 查询返回日期时间(值)和表达式(标签),以{month} - {year}格式输出日期值。 Actual label values that appear in the dropdown are "Jun-2012","Mar-2012", etc. The InDate parameter is also used as an input to drive two other date dropdown lists. 下拉列表中显示的实际标签值为“Jun-2012”,“Mar-2012”等InDate参数还用作驱动另外两个日期下拉列表的输入。

The current iteration of the report URL is as follows: 报告URL的当前迭代如下:

dadsql04/ReportServer/Pages/ReportViewer.aspx?%2fRED+Data+Warehouse/RRMemo&rs%3aCommand=Render&rc%3aParameters=false&InDate=06/30/2012

When I load the URL I get the following error message: 当我加载URL时,我收到以下错误消息:

The InDate parameter is missing a value InDate参数缺少值

I have tried using different values for the InDate parameter, escaping the slashes, etc. and nothing seems to work. 我已经尝试为InDate参数使用不同的值,转义斜杠等,似乎没有任何作用。 Any help or code sample would be appreciated. 任何帮助或代码示例将不胜感激。

It turns out the problem was that the InDate parameter was defined as a string instead of a datetime value. 事实证明问题是InDate参数被定义为字符串而不是日期时间值。 Once the parameter was changed from string to datetime the URL worked without an issue. 一旦参数从字符串更改为datetime,URL就可以正常工作。

Date parameter format looks good, but the URL you're trying to use is referencing the Report Manager component. 日期参数格式看起来不错,但您尝试使用的URL是引用报表管理器组件。

Use this URL to query the report web service directly: 使用此URL直接查询报表Web服务:

http://dadsql04/ReportServer?/RED+Data+Warehouse/RRMemo&rc:Parameters=false&InDate=06/30/2012

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM