May 12, 2014, 2:40 PM
Print window content
Hello,everyone.
I need to print the html contained within a window.
I already researched some threads in the forum related, however i could not solve my problem with any of them.
In this thread: http://forums.ext.net/showthread.php...indow-Contents I saw that a possible solution would be the following javascript code:
i am use IE11...
This is my full example code:
I need to print the html contained within a window.
I already researched some threads in the forum related, however i could not solve my problem with any of them.
In this thread: http://forums.ext.net/showthread.php...indow-Contents I saw that a possible solution would be the following javascript code:
<ext:Button runat="server" Text="Print" Icon="Printer">
<Listeners>
<Click Handler="#{Window1}.getBody().print()" />
</Listeners>
</ext:Button>
But this code give me the following javascript error: "in res://ieframe.dll/preview.js 0x80070057 - javascript runtime error"i am use IE11...
This is my full example code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="PrintDemo.WebForm1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TestPrint</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window ID="Window1" runat="server" Title="Window" Width="400" Height="400">
<AutoLoad Url="print.aspx" Mode="IFrame" >
<Params>
<ext:Parameter Name="id" Value="11" Mode="Value" />
</Params>
</AutoLoad>
<BottomBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="Button1" runat="server" Text="Print" Icon="Printer">
<Listeners>
<Click Handler="#{Window1}.getBody().print();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Window>
</form>
</body>
</html>
Thanks.