Jul 16, 2010, 4:06 PM
[CLOSED] [1.0] Print Window Contents
Hi,
I have a printer-friendly aspx page that automatically where when called by itself, prints without a problem. When I displayed this page on a Ext.Window via autoload and mode=iframe, the print out is not correct. It only prints the size of the window, not the actual contents of the printer friendly page. Is there a way to correctly print the contents of the window?
I tried the following but couldnt get it to work. Am I missing something here ? Perhaps an alternative solution? Any help would be greatly appreciated
Marcelo
I have a printer-friendly aspx page that automatically where when called by itself, prints without a problem. When I displayed this page on a Ext.Window via autoload and mode=iframe, the print out is not correct. It only prints the size of the window, not the actual contents of the printer friendly page. Is there a way to correctly print the contents of the window?
I tried the following but couldnt get it to work. Am I missing something here ? Perhaps an alternative solution? Any help would be greatly appreciated
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script type="text/javascript">
function printWindow() {
Ext.getCmp('winEUA').iframe.print();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Slate">
</ext:ResourceManager>
<ext:Window Title="End User Agreement" runat="server" ID="winEUA" Width="400" Height="400">
<BottomBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" ID="btnPrint" Text="Print" Icon="Printer">
<Listeners>
<Click Handler="printWindow();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
<AutoLoad Url="http://msdnaa.oit.umass.edu/Neula.asp" Mode="IFrame"></AutoLoad>
</ext:Window>
</form>
</body>
</html>
Thanks,Marcelo
Last edited by geoffrey.mcgill; Jul 19, 2010 at 10:45 PM.