RDLC報表控件reportview顯示問題(高度自適應)


代碼:

<table style="background-color: ; overflow: hidden; height:100%;  width: 100%; vertical-align:top;">
             <tr style="">
                 <td style="height: 100%;">
                 </td>
                 <td>
                      <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
    Font-Size="8pt" InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana"
    WaitMessageFont-Size="14pt" style="width:100%; overflow:hidden;">
    <LocalReport ReportPath="D:\wwwroot\reportNew\RDLC\rdlc_temple\rdlc.rdlc">
    </LocalReport>
    </rsweb:ReportViewer>                

</td>
             </tr>
         </table>

顯示問題:在ff和IE8下,會在報表上部顯示一片空白區域,影響美觀,如圖:

解決辦法:

1、去掉紅色字體的style設置,即 height:100%;

<table style="background-color: ; overflow: hidden; height:100%;  width: 100%; vertical-align:top;">
             <tr style="">
                 <td style="height: 100%;">
                 </td>
                 <td>
                      <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
    Font-Size="8pt" InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana"
    WaitMessageFont-Size="14pt" style="width:100%; overflow:hidden;">
    <LocalReport ReportPath="D:\wwwroot\reportNew\RDLC\rdlc_temple\rdlc.rdlc">
    </LocalReport>
    </rsweb:ReportViewer>                

</td>
             </tr>
         </table>

2、直接使用div作為容器

 <div id="mainPanel" style="background-color: ; border-left:1px solid scrollbar; overflow: hidden; height: 100%;">
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
    Font-Size="8pt" InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana"
    WaitMessageFont-Size="14pt" style="width:100%; overflow:hidden;">
    <LocalReport ReportPath="D:\wwwroot\reportNew\RDLC\rdlc_temple\rdlc.rdlc">
    </LocalReport>
    </rsweb:ReportViewer>    

</div>

如圖:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM