导航

环境:VS2008

问题1:固定报表头部

问题2:固定报表头部后,查询结果为空时会有脚本错误。

问题1的解决方法:

进入报表使用的rdlc文件,选择使用的table控件,右键属性,勾选“select Header should remain visible while scrolling”,如下图:

clip_image002

clip_image004

问题2:固定报表头部后,查询结果为空时会有脚本错误

相同问题的描述:

When viewing a report with no rows returned in a browser, get a JavaScript error stating "Object Required".
This only happens when the report table has a fixed header, has no rows returned, and there is not a footer on the report table.

官方建议:

Microsoft 在 2010/1/5 15:23 发送

Another suggestion in the interim would be to use a NoRows message for your table. This will cause a text message to be displayed instead of the problematic fixed headers if there is no data in your table.
Thanks again,
Chris B.
SSRS Team

Microsoft 在 2010/1/5 15:20 发送

Hello,
Thanks for writing in about this. Based on your description, this is a bug that we are aware of and that is fixed in the next release of the ReportViewer coming in VS 2010.
Best regards,
Chris B.
SSRS Team

原文连接:

http://connect.microsoft.com/SQLServer/feedback/details/483641/reporting-services-report-viewer-object-required-javascript-error-on-empty-table-with-fixed-header

我的解决步骤:

进入报表使用的rdlc文件,选择table控件,按下F4进行属性窗口,设置table的NoRows:没有符合要求的数据。如下图:

clip_image006