Feb 22, 2013, 3:40 AM
[CLOSED] Print window content
Hello,
I need to print the html contained within a window without printing the button that triggers the impression.
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:
Anyway I need any solution that prints only the html contained in the window. In my example, the result would only be printed the word "Test".
This is my full example code:
I need to print the html contained within a window without printing the button that triggers the impression.
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: "Uncaught TypeError: Object [object Object] has no method 'print'"Anyway I need any solution that prints only the html contained in the window. In my example, the result would only be printed the word "Test".
This is my full example code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="CidadeDaConfeccao.Test" %>
<%@ 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 id="Head1" runat="server">
<title>Ext.Net Example</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">
<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>
<Content>
<asp:Panel ID="PainelBoleto" runat="server">
Test
</asp:Panel>
</Content>
</ext:Window>
</form>
</body>
</html>
Thanks.
Last edited by Daniil; Mar 04, 2013 at 7:49 AM.
Reason: [CLOSED]