> open notepad doc copy paste below text
Report Header Section
Bill no : 101
______________________________________________
Detail Section
Item Code Qty Amount
[ItemCode] [Qty] [Amount]
______________________________________________
Report Footer Section
Grand Total [GrandTotal]
______________________________________________
> set font 'courier new'
> open printer settings set papersize & printer
check paper is wasting or not
It will definitely work in text document
create bill dynamically,
billstr= feedcutstr("heading",36,right) + vbnewline;
e.g input "headings" output -> " headings "
billstr+= feedcutstr("--------------------------------------",36,right) + vbnewline;
for(i=0;i<dtbill.rows.count;i++)>
{
if (i==0)
{
billstr += feedcutstr("ItemCode",20,Left) + feedcutstr("Qty",5,right) + feedcutstr("Amount",11,right)+ vbnewline;
billstr+= feedcutstr("--------------------------------------",36,right) + vbnewline;
}
billstr += feedcutstr(dtbill.rows[i]["itemcode"],20,Left)
billstr += feedcutstr(dtbill.rows[i]["Qty"],5,right)
billstr += feedcutstr(dtbill.rows[i]["Amount"],11,right) + vbnewline;
}
// now, write bill str in text file
StreamWriter sw = new StreamWriter("D:\\Test.txt");
sw.WriteLine(billstr);
sw.Close();
//then print notepad file(your bill)
objProcess.StartInfo.FileName = "D:\\test.txt";
objProcess.StartInfo.Verb = "Print";
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
objProcess.StartInfo.UseShellExecute = true;
objProcess.Start();
Happy coding!
:)