Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ReportViewer control and scaling issue

322 views
Skip to first unread message

Keith

unread,
Oct 26, 2005, 3:30:02 PM10/26/05
to
When using the reportviewer control on a web page, we would like to set the
width and heighth to a percentage of the container that it is placed in. It
appears that the defaults are 400px. Of course these can be changed, but you
may experience horizontal and/or vertical scroll bars or a window that is too
large for the report. What we are trying to achieve is to have the contents
of the exposed SRS report scale properly when the size of the browser window
is changed. Has anyone else come across or tried to solve this issue ?

Andrew

unread,
Oct 27, 2005, 8:51:05 AM10/27/05
to
Keith,
What I did was create one table with one cell and set the height and width
to 100%. Next put the report viewer control inside the table and set the
height and width to lets say 95%(this can be flexible whatever fits your
situation). The outside table will act as a container and will adjust
appropriately to the users screen resolution and the ReportViewer control
will just follow the tables lead.
--
Andrew
MCSA,MCDBA

--
Andrew
MCSA,MCDBA

Keith

unread,
Nov 7, 2005, 5:03:05 PM11/7/05
to
Thank you for the response.

I did try that as evidenced in this code:
<table id="rptViewer" runat=server align=center width="100%"
height="100%">
<tr>
<td>
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
Font-Names="Verdana" Font-Size="8pt" Height="95%" ProcessingMode="Remote"
Width="95%" ShowCredentialPrompts="true">
<ServerReport
ReportPath="/chartingtest/horizontalreport_large"
ReportServerUrl="http://localhost/reportserver" />
</rsweb:ReportViewer>
</td>
</tr>
</table>


As you can see I am using SQL Reporting Services ReportViewer control. With
this configuration, nothing is rendered within the reportviewer when I run
the application. From what I see, the ReportViewer is not accepting a
percenrtage width.

Any other ideas are greatly appreciated.

Michael R

unread,
Dec 2, 2005, 6:56:04 PM12/2/05
to
I have experienced the same difficulty. When the Height property of the
reportviewer control is set to a percentage, it appears that the report does
not display - only the toolbar and parameters. The width as a percentage
seems to work just fine.

Is this a bug in the ReportViewer control? Is there a workaround or fix?

Mike

Rajeev Karunakaran [MSFT]

unread,
Dec 14, 2005, 10:18:39 PM12/14/05
to
Please see Question 14 in the FAQ: http://www.gotreportviewer.com/

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"Michael R" <Mich...@discussions.microsoft.com> wrote in message
news:B9AE8223-6164-4B8A...@microsoft.com...

Michael R

unread,
Jan 11, 2006, 8:04:02 PM1/11/06
to
I added the following code to my body tag - and it worked!!! The
reportviewer control acts as if the height were set to 100% (give or take,
based on what you subtract from the 'clientHeight'). I also added the script
to the onload event, so my report will always be the correct height.

<body
onresize="javascript:document.getElementById('ReportViewer1').style.height =
document.documentElement.clientHeight - 100;">

hope this helps. Enjoy!

Mike Rainey

thejez

unread,
Jan 20, 2006, 9:59:04 AM1/20/06
to
I have the same issue with the control not recognizing height. I am going to
submit it as a bug even though this workaround *may* work its very kludgey
and the bug should be fixed (or else and explanation should be made here by
MS).

Raghu

unread,
Jan 31, 2006, 4:50:51 PM1/31/06
to
Try removing the code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> at the top of the aspx
page.

I too had the same issue, but was able to fix it by deleting the above
code in my aspx page that hosted the reportviewer control.

0 new messages