This is my code its printing in normal printer .. but instead of normal printing machine i want to use zebra printing machine tpl 2844 for printing the ReturnIDcount with barcode ..
what should be my first step for this process
try
{
string Patient_name = NameTxtBx.Text, Export_TO = ToTxtBx0.Text ;
int PatNoVal;
PatNoVal = Convert.ToInt32(PatNo.Text);
PatNoVal = int.Parse(PatNo.Text);
decimal PatID = decimal.Parse(PatID_NO.Text);
int? replay_To_type = Int16.Parse(DropDownList1.SelectedValue);
int? reptype = Int16.Parse(RadioButtonList2.SelectedValue);
try
{
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_NEW_TRANSACTIONS";
cmd.Parameters.AddWithValue("@Patient", Patient_name);
cmd.Parameters.AddWithValue("@E_TO", Export_TO);
cmd.Parameters.AddWithValue("@R_type", reptype);
cmd.Parameters.AddWithValue("@User_name", Label1.Text = Session["name"].ToString());
cmd.Parameters.AddWithValue("@ReportType", replay_To_type);
cmd.Parameters.AddWithValue("@Patient_no", PatNoVal);
cmd.Parameters.AddWithValue("@Patient_ID_NO", PatID);
cmd.Parameters.Add("@ReturnIDcount", SqlDbType.NVarChar, 50);
cmd.Parameters["@ReturnIDcount"].Direction = ParameterDirection.Output;
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
Print("Your ID is : " + cmd.Parameters["@ReturnIDcount"].Value.ToString());
}
catch (Exception ex)
{
Message("Block 3: Error\nThe Reported fault is:\n" + ex.Message, this);
}
PatNo.Text = "";
NameTxtBx.Text = "";
ToTxtBx0.Text = "";
DropDownList1.SelectedIndex = -1;
RadioButtonList2.SelectedIndex = -1;
}
catch
{
Message(" ERROR 20", this);
}
}
}
catch
{
Message("data is incorrect", this);
}
}
//private void Print(string recordIdCount)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload = new function(){");
sb.Append("var printWin = window.open('', '', 'left=0");
sb.Append(",top=0,width=1000,height=600,status=0');");
sb.Append("printWin.document.write(\"");
sb.Append(recordIdCount);
sb.Append("\");");
sb.Append("printWin.document.close();");
sb.Append("printWin.focus();");
sb.Append("printWin.print();");
sb.Append("printWin.close();};");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "key", sb.ToString(), false);
}
protected void DropDownList1_DataBound(object sender, EventArgs e)
{
DropDownList1.Items.Insert(0, "--Select One--");
}