<script type="text/javascript"> function CallPrint(strid) { var prtContent = document.getElementById(strid); var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); prtContent.innerHTML = strOldOne; } </script> <title></title> </head> <body> <form runat="server" > <div id="prntGrid"> <asp:GridView ID="grdReg" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" PageIndex="10" ShowFooter="True" PageSize="20"> <AlternatingRowStyle BackColor="#CCCCCC" /> <FooterStyle BackColor="#CCCCCC" /> <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" /> <PagerSettings Mode="NumericFirstLast" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#F1F1F1" /> <SortedAscendingHeaderStyle BackColor="#808080" /> <SortedDescendingCellStyle BackColor="#CAC9C9" /> <SortedDescendingHeaderStyle BackColor="#383838" /> <Columns> <asp:BoundField DataField="REGNO" HeaderText="Registration No" /> <asp:TemplateField HeaderText="Patient Name"> <ItemTemplate> <asp:Label ID="lblPatName" runat="Server" Text=""></asp:Label> </ItemTemplate> <ItemStyle Width="400"/> </asp:TemplateField> <asp:TemplateField HeaderText="Age"> <ItemTemplate> <asp:Label ID="lblAge" runat="Server" Text="" Width="60px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Registration Date"> <ItemTemplate> <asp:Label ID="lblDate" runat="Server" Text="" Width="60px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Adress"> <ItemTemplate> <asp:Label ID="lblAdress" runat="Server" Text=""></asp:Label> </ItemTemplate> <ItemStyle Width="1000"/> </asp:TemplateField> <asp:TemplateField HeaderText="Sex"> <ItemTemplate> <asp:Label ID="lblSex" runat="Server" Text="" Width="60px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="REGCONTCODE" HeaderText="Company Code" /> <asp:BoundField DataField="REGBILLTYPE" HeaderText="Bill Type" /> <asp:BoundField DataField="REGRESPHONE" HeaderText="Phone No" /> <asp:BoundField DataField="REGMOBILENO" HeaderText="Mobile No" /> <asp:BoundField DataField="REGRTNO" HeaderText="RT No" /> </Columns> </asp:GridView> </div> <div> <input id="Button1" type="button" name="btnPrint" value="Print" onClick="javascript:CallPrint('divPrint');" Runat="Server" /> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)