Internet Explorer modal dialogs require IFrames to access the WebBrowser COM interface. SQL Server 2008 R2 changed from using IFrames to AJAX update panels. If you launch SQL Server 2008 R2 report using the IE modal dialog, and try to print the report using the print option on the report, then the following error message appears:
--------------------------- Print Error --------------------------- An error occurred trying to get the current window. --------------------------- OK ---------------------------
---------------------------
Print Error
An error occurred trying to get the current window.
OK
<html> <head></head> <body> <button onClick="window.showModalDialog ('http://serverName/ReportServerR2?/SimpleSelect&rc:Parameters=False&rs:ClearSession=True',null, 'dialogHeight:730px;dialogWidth:1010px');" >Click Me</button> </body>
<html>
<
html
>
<head></head>
head
></
<body>
body
<button onClick="window.showModalDialog ('http://serverName/ReportServerR2?/SimpleSelect&rc:Parameters=False&rs:ClearSession=True',null, 'dialogHeight:730px;dialogWidth:1010px');" >Click Me</button>
button
onClick
=
"window.showModalDialog ('http://serverName/ReportServerR2?/SimpleSelect&rc:Parameters=False&rs:ClearSession=True',null, 'dialogHeight:730px;dialogWidth:1010px');"
>Click Me</
</body>
</
Open the page in IE and Click the button.
To use a modal dialog with SQL Server 2008 R2 report, have the modal dialog contain an IFrame containing the report.