programing tip

SSRS 2008 R2-SSRS 2012-ReportViewer : Safari / Chrome 보고서는 있지만 Firefox / Internet Explorer 8에서는 제대로 작동합니다. 왜 그런가요?

itbloger 2020. 9. 24. 07:36
반응형

SSRS 2008 R2-SSRS 2012-ReportViewer : Safari / Chrome 보고서는 있지만 Firefox / Internet Explorer 8에서는 제대로 작동합니다. 왜 그런가요?


에 간단한 보고서가 SSRS 2008 R2있지만 Safari 또는 Chrome에는 전혀 표시되지 않습니다. Microsoft의 온라인 설명서에 따르면 이러한 브라우저는 제한된 방식으로 지원됩니다. 그러나 데이터 "로드 중"시계가 완료된 후에는 아무것도 볼 수 없습니다. 페이지 상단의 매개 변수 표시 줄과 이동 경로 탐색 섹션이 모두 있습니다. 또한 Safari 및 Chrome에서 모든 형식으로 저장 / 내보내기를 할 수 있습니다. 단지 비어있는 보고서 섹션 자체는 표시하지 않습니다.

인증서와 보안 연결을 사용해야합니까 (현재 HTTPS로 설정되지 않고 HTTP 만 사용)? 조정해야하는 서버 측 구성이 있습니까? 사람이 표시 성공했다 ANY 이전 SSRS 버전 (2005)를 사용하여 사파리 / 크롬에 대한 보고서를?

나는 Safari 5.0.4Chrome 10.0.648.151. 이 두 브라우저의 유사점은 둘 다 WebKit 기반이라는 것을 알고 있습니다.

이 보고서는 Internet Explorer 8 (물론) 및 Firefox 4.0에서 성공적으로 렌더링됩니다.

누군가가 이것에 대해 밝힐 수 있다면 정말 감사하겠습니다.


궁극적 인 솔루션 (SSRS 2012에서도 작동합니다!)

다음 스크립트를 " C : \ Program Files \ Microsoft SQL Server \ MSRS10_50.MSSQLSERVER \ Reporting Services \ ReportManager \ js \ ReportingServices.js "(SSRS 서버에서)에 추가합니다.

function pageLoad() {
    var element = document.getElementById("ctl31_ctl10");
    if (element)
    {
        element.style.overflow = "visible";
    }
}

실제로 div의 이름이 항상인지 모르겠습니다 ctl31_ctl10. 제 경우에는 (대신 SQL Server 2012 azzlak found 이상 ctl32_ctl09)입니다.

이 솔루션이 작동하지 않으면 브라우저에서 HTML을보고 스크립트가 overflow : auto 속성을 overflow : visible로 변경하여 제대로 작동하는지 확인합니다 .


ReportViewer 제어를위한 솔루션

이 스타일 라인을 .aspx페이지 (또는 .css가능한 경우 링크 된 파일)에 삽입합니다.

#reportViewer_ctl09 {
  overflow:visible !important;
}

이유

Chrome 및 Safari 렌더링 오버플로 : Internet Explorer와 다른 방식으로 자동 .

SSRS HTML은 QuirksMode HTML이며 IE 5.5 버그에 의존합니다. IE가 아닌 브라우저에는 IE quirksmode가 없으므로 HTML을 올바르게 렌더링합니다.

SSRS 2008 R2 보고서에서 생성 된 HTML 페이지 에는 overflow : auto 스타일 있는 div포함되어 있으며 보고서를 보이지 않는 보고서로 변환합니다.

<div id="ctl31_ctl10" style="height:100%;width:100%;overflow:auto;position:relative;">
...</div>

수동으로 변경 (Chrome의 디버그 창 사용) final HTML overflow : auto in overflow : visible Chrome에서 보고서를 수 있습니다.

저는 Tim의 솔루션을 좋아 합니다 . 쉽고 작동합니다.

그러나 여전히 문제가 있습니다. 사용자가 매개 변수를 변경할 때마다 (내 보고서는 매개 변수를 사용합니다!) AJAX가 div를 새로 고치면 overflow : auto 태그가 다시 작성되고 스크립트가 변경되지 않습니다. 이 기술 노트 세부 사항 은 문제점에 대해 설명합니다.

이는 AJAX 패널로 빌드 된 페이지에서 전체 페이지를 새로 고치지 않고 AJAX 패널 만 상태를 변경하기 때문에 발생합니다. 따라서 태그에 적용한 OnLoad 이벤트는 페이지가 처음로드 될 때 한 번만 실행됩니다. 그 후에 AJAX 패널을 변경해도 더 이상 이러한 이벤트가 트리거되지 않습니다.

einarq 씨는 여기 에서 해결책을 제안 했습니다 .

또 다른 옵션은 함수의 이름을 pageLoad로 바꾸는 것입니다.

이 이름을 가진 모든 함수는 페이지에있는 경우 ASP.NET Ajax에 의해 자동으로 호출되며 각 부분 업데이트 이후에도 호출됩니다. 이렇게하면 body 태그에서 onload 속성을 제거 할 수도 있습니다.

그래서 솔루션에 표시된 개선 된 스크립트를 작성했습니다.


CSS 기반 솔루션

Reporting Services의 스타일 시트에 다음을 추가 할 수 있었고 Chrome에서 수정되었습니다.

면책 조항 : 이것은 브라우저 간 호환성에 대해 철저히 테스트되지 않았습니다.

/ ************** CHROME BUG FIX ***************** /
div # ctl31_ctl09,
div # ctl31_ctl10
{
    오버플로 : 보이는! 중요한;
}
/ ********************************************* /

ReportingServices.css파일 시작 부분에 추가 하십시오.

저에게 해당 파일은 다음 위치에 있습니다.

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\Styles\ReportingServices.css


이것은 알려진 문제 입니다. 문제는 div 태그에 "overflow : auto"스타일이 있다는 것입니다. 이는 분명히 Safari 및 Chrome에서 사용되는 WebKit에서 잘 구현되지 않습니다 (Emanuele Greco의 답변 참조 ). RS : ReportViewerHost 요소를 사용하라는 Emanuele의 제안을 활용하는 방법을 몰랐지만 JavaScript를 사용하여 해결했습니다.

문제

여기에 이미지 설명 입력

해결책

"overflow : auto"는 id가 "ctl31_ctl10"인 div 요소의 스타일 속성에 지정되어 있으므로 스타일 시트 파일에서이를 재정의 할 수 없으므로 JavaScript를 사용했습니다. 다음 코드를 "C : \ Program Files \ Microsoft SQL Server \ MSRS10_50.MSSQLSERVER \ Reporting Services \ ReportManager \ js \ ReportingServices.js"에 추가했습니다.

function FixSafari()
{    
    var element = document.getElementById("ctl31_ctl10");
    if (element) 
    {
        element.style.overflow = "visible";  //default overflow value
    }
}

// Code from https://stackoverflow.com/questions/9434/how-do-i-add-an-additional-window-onload-event-in-javascript
if (window.addEventListener) // W3C standard
{
    window.addEventListener('load', FixSafari, false); // NB **not** 'onload'
} 
else if (window.attachEvent) // Microsoft
{
    window.attachEvent('onload', FixSafari);
}

노트

시도해 보지 않은 SSRS 2005 솔루션 이있는 같지만 "DocMapAndReportFrame"클래스를 찾을 수 없기 때문에 SSRS 2008에 적용 할 수 없다고 생각합니다.


CSS 기반 시스템 전체 솔루션

여기에는 JavaScript 또는 Ajax 프레임 또는 기타 래퍼가 필요하지 않습니다. Internet Explorer, Firefox, Safari 및 Chrome에서 테스트되었습니다.

이는 보고서 서버의 스타일 시트 수준에서 수정할 수 있습니다.

먼저보고 서비스가 설치된 디렉터리로 이동합니다. 제 경우에는 ( SQL Server 2012 SP1) 다음과 같습니다.

C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer

이 디렉토리에서 reportserver.config라는 파일을 찾을 수 있습니다.

HTML 뷰어 및 보고서 관리자 용 스타일 시트 사용자 정의를 참조하십시오 .

해당 파일에 (위 문서에서) 다음과 같은 단일 XML 행을 삽입하십시오.

<Configuration>
...
          <HTMLViewerStyleSheet>SafariChromeFix</HTMLViewerStyleSheet>
...
</Configuration>

저장하십시오.

그들이 하지 않는 위의 링크에서 당신에게하면이 항목이 완전히 기본 스타일 시트를 무시한다는 것입니다. div 스타일 시트를 추가하여 보고서를 렌더링하도록 처음 시도했지만 나머지는 모두 손상되었습니다. reporserver.config 파일에 대한이 편집이 확장되지는 않았지만 실제로 기본 스타일 시트를 대체한다는 것을 알았을 때 기본 스타일 시트를 복사하고 모든 것이 작동하기 시작했습니다.

다음으로 Styles 디렉토리 ( C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\Styles) 로 내려갑니다 .

SP_Full.css라는 파일의 복사본을 만들고 복사본의 이름을 SafariChromeFix.css로 지정합니다. 이 시점에서 SafariChromeFix.css는 SP_Full.css와 동일해야합니다.

SafariChromeFix.css를 편집하고 맨 위에 다음 줄을 추가합니다.

div {
    overflow: visible !important;
}

저장해.

이 보고서가 저장되면이 Reporting Services 인스턴스에 대한 모든 기존 보고서가 Chrome 및 Safari를 포함한 모든 브라우저에서 렌더링됩니다.

참고 :

가능할뿐만 아니라 reportserver.config를보고 서비스에 대한 업데이트로 덮어 쓸 가능성이 매우 높으므로 <HTMLViewerStyleSheet>SafariChrome</HTMLViewerStyleSheet>시간이 지남에 따라 태그 를 추가해야 할 수도 있습니다 .

이것은 또한 우리에게 기본 스타일 시트를 쪼개고 이미 작동하는 것부터 시작하여 많은 다른 사용자 정의 변경을 할 수있는 장소를 제공합니다. 또한 기본 스타일 시트가 아니기 때문에 업그레이드 및 패치 중에 새 사용자 정의 CSS 파일을 덮어 쓰지 않습니다.


내 경우에는 잘못된 DIV는 "ctl31_ctl09" 당신이 변경 시도에 대해 위의 솔루션은 작업을하지 않도록 경우 var element = document.getElementById("ctl31_ctl10");var element = document.getElementById("ctl31_ctl09");


내 해결책은 다음 <script>추가하는 것입니다.

Reporting Services \ ReportManager \ Pages \ Report.aspx

스크립트는 표시되는 보고서 콘텐츠의 상위 1을 대상 으로하고 보고서 가 여러 페이지 보고서를 통한 페이징을 포함 하여 2를 로드 할 때마다 설정합니다 .style.overflow:visible

if (window.addEventListener && document.querySelector) window.addEventListener("load", function () {

    // drop out if Sys.Application.add_load is undefined
    if (!window.Sys || !Sys.Application || !Sys.Application.add_load) return;

    // register a function for when report data is loaded
    Sys.Application.add_load(function () {

        // get the report content control
        var n = document.querySelector("[id^=VisibleReportContent]");

        if (n) {

            // get the report content control's parent
            n = n.parentNode;

            if (n) {

                // revert overflow:hidden to "visible"
                n.style.overflow = "visible";

            }
        }

    });
});

1 :이 방법 우리는 변화하는 경향, 즉,이 생성 된 식별자 대상이없는 ctl31_ctl09, ctl31_ctl10, ctl32_ctl09, 등
2 참조Sys.Application.add_load()


Reporting Services의 SQL Server 2014 릴리스는 Google Chrome 브라우저에 대한 지원을 추가하지만 아직 iOS는 지원하지 않습니다. 여기에서 자세한 내용을 참조 하십시오 .


저에게 이름은 " ctl32_ctl09 "( SQL Server 2012 SP1, MSRS11의 SSRS )였습니다.


나는 함께 크롬으로 가야했다 F12그리고 내가 가진 발견 ctl32 내 사업부에 _ctl09하지 ctl31_ctl09을.

이것은 SQL Server 2012 가 포함 된 Windows Server 2008 R2 64Bit 용입니다 . 스크립트를 추가 한 다음 SSRS를 다시 시작하고 브라우저 캐시를 지 웁니다.

// Chrome에서 SSRS 보고서를 표시하도록 수정

    function pageLoad() {
    var element = document.getElementById("**ctl32**_ctl09");
    if (element)
    {
        element.style.overflow = "visible";
    }
}

안타깝게도 주요 답변은 Internet Explorer 보고서에서 부동 (절대 위치) 열을 분리합니다. 따라서 특별히 WebKit을 찾고 있기 때문에 좋아하지 않는 약간 수정했지만 작동 중입니다.

//SSRS 2012 Chrome fix
function pageLoad() {
    var element = document.getElementById("ctl32_ctl09");
    var isWebKit = !!window.webkitURL;    // Chrome or safari really (WebKit browsers).
    // We don't want to do this fix in Internet Explorer, because it breaks floating columns
    if (element && isWebKit)
    {
        element.style.overflow = "visible";
    }
}


To get around having to hardcode the element ID, I edited the ReportingServices.js file on the RS server @ [Drive]:\Program Files\Microsoft SQL Server\[Reporting Services Instance]\Reporting Services\ReportManager\js\ReportingServices.js to include some code to fetch jQuery, load it into the page, and then find all elements where overflow is set to auto.

Insert the following code at the top of the ReportingServices.js file

var loadjQuery = function (cb) {
    if (typeof (jQuery) == 'undefined') {
        var scr = document.createElement('script');
        scr.setAttribute('type', 'text/javascript');
        scr.setAttribute('src', 'http://code.jquery.com/jquery-latest.js');

        if (scr.readyState) {
            scr.onreadystatechange = function () {
                if (scr.readyState === 'complete' || scr.readyState === 'loaded') {
                    scr.onreadystatechange = null;
                    if (typeof (cb) === 'function') {
                        args = [].slice.call(arguments, 1);
                        cb.apply(this, args);
                    }
                }
            };
        }
        else {
            scr.onload = function () {
                if (typeof (cb) === 'function') {
                    args = [].slice.call(arguments, 1);
                    cb.apply(this, args);
                }
            };
        }

        var head = document.getElementsByTagName('head')[0];
        head.insertBefore(scr, head.firstChild);
    }
}

Then the next line after that is what was originally in the JS file.

After that, add the following code

var _rmFixReady = false;
function pageLoad() {
    loadjQuery(function () {
        _rmFixReady = true;
    });
    if (_rmFixReady) {
        var overflowElements = $('div').filter(function () { return $(this).css('overflow') == 'auto'; });
        overflowElements.each(function () {
            $(this).css('overflow', 'visible');
        });
    }
}

I just finished testing this with Chrome 27 and IE 10 on a RM2012 instance and it worked great.


The problem still exists in Chrome 22.0.1229.79.

YMMV, but I have found that removing height from the ReportViewer tag fixes this issue.

I was having this issue with SSAS reports, but not the SSRS ones. I couldn't figure out why until I checked the differences in the pages (a consultant had done the SSAS reports). He was setting ReportViewer Height=60% and the SSRS reports were not specifying the height.

Once I removed Height, my reports displayed.


For SSRS 2012 on Windows Server 2008 R2 x64, a working script is:

function pageLoad()
{
    var element = document.getElementById("ctl31_ctl09");
    if (element)
    {
        element.style.overflow = "visible";
    }

    if (window.addEventListener) // W3C standard
    {
         window.addEventListener('load', FixSafari, false); // NB **not** 'onload'
    }
    else
        if (window.attachEvent) // Microsoft
        {
            window.attachEvent('onload', FixSafari);
        }
}

function FixSafari()
{
    var element = document.getElementById("ctl31_ctl09");
    if (element)
    {
        element.style.overflow = "visible";  // Default overflow value
    }
}

All the suggested above versions were not working at all.


One problem with the overflow:visible fix is that floating headers are broken across all browsers. The following script will leave Internet Explorer alone and apply the fix only to non-Internet Explorer browsers. With this, all functionality is retained for Internet Explorer users and other browsers can still view the reports.

function pageLoad() {
    var eval = getInternetExplorerVersion();
    if (eval == -1)
    {
        var element = document.getElementById("ctl31_ctl09");
        if (element)
        {
            element.style.overflow = "visible";
        }
    }
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent;
        var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat( RegExp.$1 );
    }
    return rv;
}

I tried the approaches and it worked for me, but our system administrators were skeptical about these change.

Instead of setting height to 100% on the ReportViewer, I used a fixed height, and it managed to work in my application for Internet Explorer and Chrome.


I've never had any luck with displaying reports in Chrome. Most of Microsoft's documentation doesn't even list it so I assume Chrome must have trouble interpreting something in the ASP.

See Browser Support for Reporting Services and Power View.

I'm running Chrome 11 and experience the same behavior as you.


Chrome에서 보고서를 보는 데 동일한 문제가 발생했습니다. Google 크롬에 "SSRS Report Fix"확장 프로그램을 추가하여 문제를 해결했습니다. https://chrome.google.com/webstore/detail/ssrs-report-fix/fjbdfjiheheafbioiejbdpalmojkeobk

참고 URL : https://stackoverflow.com/questions/5428017/ssrs-2008-r2-ssrs-2012-reportviewer-reports-in-safari-chrome-but-works-fine

반응형