User288213138 posted
Hi Donald416,
I want to have different ticket template in a web form on my website where any user can choose, so that when the user chooses a particular template, the user will input data and preview before
printing.
For how to design Ticket templates you can refer to this link:
https://www.ticketmatic.com/docs/tickets/configure_ticket_sales/ticketlayout/
About how to preview the design template before printing, you can refer below code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Panel ID="pnlContents" runat="server">
You can set the Ticket style in here
</asp:Panel>
<br />
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick="return PrintPanel();" />
</form>
<script>
function PrintPanel() {
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>Tickets templates</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 5000);
return false;
}
</script>
</body>
</html>
Hope this can help you.
Best regards,
Sam