This is a migrated thread and some comments may be shown as answers.

Controlling reportviewer height in usercontrol

2 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 23 Oct 2013, 01:35 AM
Hello,

I've got a reportviewer in a usercontrol and each page that displays the user control sets a flag to change the height/width to show the correct size for portrait or landscape, depending on the report being shown.  Up until now, this has worked fine.

Since moving to IE10 and also setting the masterpage to use <!DOCTYPE html> instead of the usual transitional, etc, I've had to add specific style into each page to force the size accordingly, eg for protrait

<style type="text/css">

div#MainContent_repView1_ReportViewer, #MainContent_repView1_ReportViewer_ReportArea_ReportArea, #MainContent_repView1_ReportViewer_ReportTable, #MainContent_repView1_ReportViewerReportFrame

{

height: 1200px;

}

</style>


Obviously this is not ideal as it is no longer controlled simply by my portrait/landscape flag.

Any suggestions on how this could be easily controlled by the usercontrol so I don't have to keep putting this onto each page?
The only way I can think of is to have two report viewers on the one usecontrol and use whichever one is appropriate.

Thanks

Cheryl

2 Answers, 1 is accepted

Sort by
0
Cheryl
Top achievements
Rank 1
answered on 23 Oct 2013, 01:50 AM

Further to this, putting in all these styles into a usercontrol is not helpful either as it assumes the usercontrol is going to be inside a repview1 which is inside MainContent - and its not always going to be!

extra info:
my usercontrol also includes this:

html#html, body#body, form#form1

 

 

{

 

height: 100%;

 

 

}

 

 

 

 

0
KS
Top achievements
Rank 1
answered on 25 Oct 2013, 04:27 PM
Hi,

Set the user control (and the viewer in it) sizes in percentage, and the content will be sized according to the container.

-KS
Tags
General Discussions
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Cheryl
Top achievements
Rank 1
KS
Top achievements
Rank 1
Share this question
or