Printing A String From Server Side C#

My question is that I have to print a string from server side C#
Time is of essence for me on this one I hope some one here can help me.


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(" alert('");
strAlert.Append("Receipt:" + parsedreceipt +
"\n");
strAlert.Append("');");

this.RegisterStartupScript("startup",strAlert.ToString());
}

if(e.CommandName =="Print")
{
string parsedreceipt = null;
parsedreceipt = DecodeReceipt
(e.Item.Cells[3].Text);



}





}
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories