ReportViewer control rendering too wide on WebForm
I have a ReportViewer (ver 10) that is rendering far wider than the box it's meant to display in. The problem is that the Parameters area is appearing much wider than the actual report area. If I put an "overflow: auto" in the div that contains the ReportViewer control, then I get a horizontal scrollbar at the bottom, but then in order to click the "View Report" button I have to scroll way over, thus moving the entire report.
Ideally I would like the Parameters area to stay stationary, but a horizontal scrollbar to appear on the report area so that it can be scrolled if necessary. What is the best way to go about doing this?
Here's what my control setup looks like now:
<div class="reportingFrame" style="text-align: center; width: 100%; overflow: auto">
<sam:ReportViewer ID="UiReportViewer" runat="server"
AsyncRendering="False"
ProcessingMode="Remote"
ShowExportControls="False"
ShowPrintButton="False"
ShowPromptAreaButton="False"
开发者_Python百科 ShowRefreshButton="False"
SizeToReportContent="True"
Width="100%" />
</div>
Currently I'm looking at some jQuery tricks to reformat the output from the ReportViewer control into a better system, so if anyone has any suggestions along that route, I'd be happy to hear them.
I ended up going the javascript/jQuery route that let me resize the Parameters Area box as I needed. There is still some graphical tweaking that could be used to make the scrollbar at the bottom properly sized, but I skipped that for this iteration. Here's the jQuery I used:
jQuery('#<%= UiReportViewer.ClientID %> > table:last > tbody > tr:first > td > div:first > div > table').width(900);
jQuery('#<%= UiReportViewer.ClientID %> > table:last > tbody > tr:eq(2) > td:first > span:first > div:first').width(900);
One thing of note, this is only good for the 10.0 version of ReportViewer. Any future or previous versions will not work with this code.
精彩评论