2

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" 
        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.

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.