Disable Pop-Up blocker to print report

Last post 08-17-2009 2:25 AM by suthish nair. 5 replies.

Sort Posts:

  • Disable Pop-Up blocker to print report

    08-16-2009, 1:37 PM
    • Member
      546 point Member
    • net fan
    • Member since 11-03-2004, 7:52 AM
    • Amman, Jordan
    • Posts 181

    Hi All,

    I'm developing an AJAX-enabled web application. In one of my pages, I try to export a report to PDF format. I don't show the report on the web page, I just export it directly to be printed.

    However, if I do this directly from my page, it won't work because this is not compatible with AJAX. So, I made the print button to open a pop-up window (by using the window.open javascript function and calling it from server side.)

    And at the page load of the pop up page, I export the report. However, the problem that happens is that the pop up page closes immediately after being opened. I tried to disable the pop up blocker in my IE8 but this didn't work.

    Any help is really appreciated.

    WADIRUM Software is a Jordan-based specialized software provider for tourism-related industries.
  • Re: Disable Pop-Up blocker to print report

    08-16-2009, 2:21 PM
    I think we cant prog disable pop up blockers.. Or plz wait for other answers. Or try, After export, Response.Write("-script language='javascript'-window.print();-/script-");


    Mark as Answer
    on the posts replys that helped you.
    My Blog -: MSChart

  • Re: Disable Pop-Up blocker to print report

    08-16-2009, 2:35 PM
    • Member
      546 point Member
    • net fan
    • Member since 11-03-2004, 7:52 AM
    • Amman, Jordan
    • Posts 181

    Thanks suthish,

    suthish nair:
    I think we cant prog disable pop up blockers

    I don't mean to disable the pop-up blocker programatically. As I said in my previous post. I did disable the pop-up blocker manually. However, the problem continued to occur. So, it seems that it's not a matter of pop-up blocking.

    Any ideas on why this is happening?

    Thanks in advance,

    WADIRUM Software is a Jordan-based specialized software provider for tourism-related industries.
  • Re: Disable Pop-Up blocker to print report

    08-16-2009, 3:04 PM
    Put a breakpoint on pop up page load and check line by line wat causing the window closing.how you export the report printed?


    Mark as Answer
    on the posts replys that helped you.
    My Blog -: MSChart

  • Re: Disable Pop-Up blocker to print report

    08-16-2009, 7:10 PM
    • Member
      546 point Member
    • net fan
    • Member since 11-03-2004, 7:52 AM
    • Amman, Jordan
    • Posts 181

    Hi suthish,

    I debugged the pop up page load, but there's no errors or exceptions that appear at all. It goes fine through all the lines until the last one, and then it closes it gives that sound like if a pop-up is caught by the browser.

    Here's how I export my report:

    // Read query string
    
            CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            string path = "report path";
            doc.Load(path);
    
            doc.SetDatabaseLogon("db user name", "db password");
            doc.SetParameterValue("parameter name", parameter_value);
    
    
            doc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ExportedReport");


    Please note that when I place a button inside the pop up page and let the user click it to export the report instead of exporting it at page load, it works fine. However, I think that letting it be exorted at page load is more user friendly.


    Thanks


    WADIRUM Software is a Jordan-based specialized software provider for tourism-related industries.
  • Re: Disable Pop-Up blocker to print report

    08-17-2009, 2:25 AM
    Answer
Page 1 of 1 (6 items)