I have a Web based POS system which needs to get information from a server and get printed client side.
I have spent 2 days searching but still i am not able to achieve what i want.
what happens is a cashier will generate a random serial number and pin which is then saved in the database, after the generation a receipt should be printed to the cashiers default printer. each cashier has there own default printer.
The printing is working exactly how it should but the Print dialog box is being shown, how would i go about printing the receipt but not displaying the Print Dialog?
i have tried many VB scripts, jquery and Javascripts. all have failed. I am printing the contents of an iFrame.
All cashiers are using Windows 7 and Internet Explorer 10.
The Following button displays the iFrame.
protected void Generate_Click(object sender, EventArgs e)
{
myIFrame.Visible = true;
}
when the page loads in the iFrame Javascript is run that will print the Frames contents
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Print", "PrintVoucher();", true);
}
Javascript
<script type="text/javascript" language="javascript">
function PrintVoucher() {
window.focus();
window.print();
return;
}
</script>