问题描述:在使用绑定一个SqlServer ReportingService的一张报表后,有些内容较长的报表会出现双滚动条的问题
解决:
- <style>
- .hiddenY
- {
- overflow-y: hidden; //去掉坚滚动条
- overflow-x: auto;
- }
- style>
- <rsweb:ReportViewer ID="reportViewer" runat="server" AsyncRendering="True" Width="100%"
- Height="100%" CssClass="report-container" KeepSessionAlive="True"> <ServerReport ReportPath="" ReportServerUrl="" />
- rsweb:ReportViewer>
- <script type="text/javascript">
- function viewerPropertyChanged(sender,e) {
- var viewer = $find('<%=reportViewer.ClientID %>');
- if (!viewer.get_isLoading()) { //在报表加载后
- $('div[id$=oReportDiv]').addClass('hiddenY'); //把报表区域的滚动条去掉
- viewer.remove_propertyChanged(viewerPropertyChanged); //撤销事件侦听
- }
- }
- Sys.Application.add_load(function () {
- $find('<%=reportViewer.ClientID %>').add_propertyChanged(viewerPropertyChanged); //在Ajax回发时,侦听报表事件
- });
- script>
阅读(1046) | 评论(0) | 转发(0) |