ReportViewer Control - Height issue

后端 未结 13 1043
南笙
南笙 2021-01-31 09:10

In my asp.net application, I am trying to open a particular report. I have the ReportViewer Control set with width of 100% and height of 100%. Now I expect that to mean that t

13条回答
  •  旧巷少年郎
    2021-01-31 09:49

    Dan, here is what we ended up doing with a little jQuery magic.

    All reports used the same Report.Master as the master page:

    <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Report.master.vb" Inherits=".Report" %>
    
    
         
        
        
    
    
        

    Then, each report page contained the ReportViewer and it's properties.

    <%@ Page Title="This Cool Report" MasterPageFile="~/masterpages/Report.Master" Language="vb" AutoEventWireup="false" CodeBehind="viewmycoolreport.aspx.vb" Inherits=".viewmycoolreport" %>
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    
        
        
    
    

    Now, when the report loads, the ReportViewer control ends up sizing itself to the size of the content window both on ready and resizing the window. The jQuery selector grabs the first div with an ID that contains "_report_" (since the ReportViewer control renders with a client id of ctl_report_). The height ends up having to be less 32 pixels because of the header in the ReportViewer control (for paging, exporting, etc).

提交回复
热议问题