Question

I am using the SSRS 2008 R2 API to programmatically load [ LoadReport() ] and render [ Render() ] reports from a report server.

The report format is HTML4.0.

The output produced is fine if the report is a single page. However when the report contains more than one page, the pages after the first page have an additional scrollbar.

Looking at the generated html, this is being caused by an overflow:auto on the generated div elements.

This is the generated html for a single page report...

<div id="oReportDiv" style="width: 100%; direction: ltr; height: 100%; overflow: auto;" dir="ltr" onscroll="CreateFixedHeaders()" onresize="CreateFixedHeaders()">

Whilst this is the generated html for a two page report...

<div id="oReportDiv" style="direction: ltr;" dir="ltr">
<div style="page-break-after: always;">
<div style="width: 100%; direction: ltr; height: 100%; overflow: auto;" dir="ltr">

This seems to be recognised as a bug by Microsoft:

"oReportDiv" overflow:auto - Scrollbars using SOAP API to render HTML 4 Report

The issue is marked as fixed, however no details or workarounds are provided.

Firstly, I'd be grateful for any more information regarding this "fix".

Additionally if this hasn't been fixed, what would be the best workaround?

Was it helpful?

Solution

This was my workaround...

        $(document).ready(function ()
        {
            $('#report_frame').load(function ()
            {
                $(this).contents().find('body > div').each(function ()
                {
                    $(this).css('overflow', 'visible');
                });
            });
        });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top