locked
About:blank window RRS feed

  • Question

  • User1510859543 posted

    We are using SSRS via URL and a javascript window.open() to run reports.  We are using windows 10/edge and now we get an extra pop-up window with about:blank in between the calling window and the actual report window.  Also tried it in Chrome and got the same thing.  Our javascript window open command is below.

                window.open(rpturl, '_blank', 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
                return false;
    

    The rpturl variable holds the url and parameters for the report.  I have tried the window.open both with and without a preceding 'void'.

    Wednesday, June 21, 2017 2:41 PM

Answers

  • User753101303 posted

    Hi,

    When using PDF don't open this link in a new window. The browser uses the mime type and knows this content should not replace the currently displayed content (likely all along with a disposition that triggers a download dialog).

    So the current content is left unchanged, a new blank window is opened but the PDF file triggers a download dialog (so this window is left blank).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 23, 2017 7:16 AM

All replies

  • User-1509636757 posted

                window.open(rpturl, '_blank', 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');

    Code you have posted seems correct. There might be other part of script code may causing the issue. Try putting an alert just before window.open and see if the code is getting executed twice or something like that.

    Wednesday, June 21, 2017 4:12 PM
  • User1967761114 posted

    Hi dlchase,

    According to your description, you got an extra blank window when invoke window.open(), but your code only invoke once, I consider might you had been called window.open() twice.

    You could check whether had code(such as the following code) which you had been invoked.

    window.open("", "_blank", "height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");

     

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    Thursday, June 22, 2017 2:56 AM
  • User1510859543 posted

    Below is function called.

            function printrpt(sname) {
                var sdates = 'Print for ' + document.getElementById('txtStartDate').value + ' to ' + document.getElementById('txtEndDate').value;
                if (confirm(sdates) == false) {
                    return false;
                }
    
                var rpturl = document.getElementById('txtrpturl').value;
                var dtStart = document.getElementById('txtStartDate').value;
                var dtEnd = document.getElementById('txtEndDate').value;
                var varFormat = document.getElementById('ddlFormat').value;
    
                switch (sname) {
    
                    case 'SalesJournal','SalesDetailByGL':
                        params = '&StartDate=' + dtStart;
                        params += '&EndDate=' + dtEnd;
                        rpturl += sname + params;
                        break;
    
                    default:
                        alert('report named ' + sname + ' is not yet available');
                        return false;
                }
    
                if (varFormat != '') {
                    if (varFormat == 'PDF') {
                        //below is for when PDFReport.aspx is done
                        //var vwin = window.open('PDFReport.aspx?rpt=' + varPageName + params, '_blank');
                        //return false;
                        rpturl += '&rc:Parameters=false';
                        rpturl += '&rs:Command=Render&rs:Format=' + varFormat + '&rc:Toolbar=False';
                    } else {
                        rpturl += '&rc:Parameters=false';
                        rpturl += '&rs:Command=Render&rs:Format=' + varFormat;
                    }
                } else {
                    rpturl += '&rc:Parameters=false';
                }
    
                window.open(rpturl, '_blank', 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
                return false;
    
            }
    

    Thursday, June 22, 2017 12:10 PM
  • User1510859543 posted

    Also, the problem seems to happen when I use rs:Format variable, e.g. rs:Format=PDF

    Thursday, June 22, 2017 12:57 PM
  • User1967761114 posted

    Hi  dlchase,

    According to the code which you provide, it seems all right, that’s so difficult  for me to give you correct suggest.

    I suggest you could debug the code and try to determine the reason which caused the issue by yourself.

    Or you’d better provide more details info about this issue to us.

     

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    Friday, June 23, 2017 7:07 AM
  • User753101303 posted

    Hi,

    When using PDF don't open this link in a new window. The browser uses the mime type and knows this content should not replace the currently displayed content (likely all along with a disposition that triggers a download dialog).

    So the current content is left unchanged, a new blank window is opened but the PDF file triggers a download dialog (so this window is left blank).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 23, 2017 7:16 AM
  • User1967761114 posted

    Hi,

    When using PDF don't open this link in a new window. The browser uses the mime type and knows this content should not replace the currently displayed content (likely all along with a disposition that triggers a download dialog).

    So the current content is left unchanged, a new blank window is opened but the PDF file triggers a download dialog (so this window is left blank).

    Yes,I agree with you. when download a file, it will popup a blank window in this case, I didn't expect that.

    I also suggest you could using the following code when download PDF file, then it won't popup a blank window.

    window.open("url", "_self")

     

    If you have any other questions, please feel free to contact me any time.<o:p></o:p>

    Best Regards<o:p></o:p>

    Even<o:p></o:p>

    Friday, June 23, 2017 7:51 AM