ReportViewer Control - Height issue

后端 未结 13 1374
南笙
南笙 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:41

    As to what I have experienced, the report viewer control renders by default with a height of 400px if SizeToReportContent is set to false.
    If you want a dynamic height, you need to add a css class to the report viewer and the following css:

    #reportViewerContainer > span
    {
        display:block;
        height:100% !important;
    }
    
    .reportViewer
    {
        height:100% !important;
    }
    

    "reportViewerContainer" is the parent container of the report viewer (a div, body etc.). The viewer renders as a span with height: 0 and inside is all the content. If you change this, everything should work fine.

提交回复
热议问题