Printing A String From Server Side C#

Oct 31 2004 10:08 PM
My question is that I have to print a string from server side C# if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells[3].Text); ===> here I need to print to the printer and pass the string parsedreceipt which is the information that I want to print. } I need your help badly on this one. Here is my function: public void ReceiptsDataGrid_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { ListItemType oType = ((ListItemType)e.Item.ItemType); if(oType == ListItemType.Item || oType == ListItemType.AlternatingItem) { e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='lightblue'"); e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='Beige'"); } if(e.CommandName =="View") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells[3].Text); StringBuilder strAlert = new StringBuilder(); strAlert.Append(""); this.RegisterStartupScript("startup",strAlert.ToString()); } if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells[3].Text); } }