You have not closed the tag properly. Please refer this link
Print ASP.Net Panel contents in ASP.Net using C# VB.Net and JavaScript
your HTML code:
<asp:View ID="View3" runat="server">
<asp:Panel ID="Panel1" runat="server">
<table style="border-style: groove; border-width: thin; background-color: White;"
align="center" width="50%">
<caption>
<br />
<asp:Label ID="Label15" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#1D599E"
Text="Bramandam Family Shop"></asp:Label>
<br />
<asp:Label ID="Label43" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#1D599E"
Text="Cash Voucher"></asp:Label><asp:Label ID="Label57" runat="server" Font-Bold="True"
Font-Size="X-Large" ForeColor="#1D599E"></asp:Label>
</caption>
<tr>
<td align="right" colspan="2">
<br />
<asp:Label ID="Label16" runat="server" Text="Date" ForeColor="Black"></asp:Label>
<asp:Label ID="Label17" runat="server" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="Label26" runat="server" Text="ID" ForeColor="Black" Width="70px"></asp:Label>
</td>
<td align="left">
<asp:Label ID="Label27" runat="server" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="center" class="style1">
<asp:Label ID="Label18" runat="server" Text="Section" ForeColor="Black"></asp:Label>
</td>
<td align="left" class="style1">
<asp:Label ID="Label19" runat="server" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="Label20" runat="server" Text="Details" ForeColor="Black"></asp:Label>
</td>
<td align="left">
<asp:Label ID="Label21" runat="server" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="Label22" runat="server" Text="Cash" ForeColor="Black"></asp:Label>
</td>
<td align="left">
<asp:Label ID="Label25" runat="server" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="Label23" runat="server" ForeColor="Black" Text="Cashier"></asp:Label>
</td>
<td align="right">
<asp:Label ID="Label24" runat="server" ForeColor="Black" Text="Signature"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
<br />
<asp:Button ID="Button2" runat="server" Text="Print" OnClientClick="return PrintGridData()"
Width="151px" OnClick="Button2_Click" />
</asp:View>