e.Graphics.DrawLine(pen, new Point((int)left, (int)top + (int)height), new Point((int)left + (int)width, (int)top + (int)height));
e.Graphics.DrawString("KFC餐厅购餐小票", titlefont, Brushes.Blue, left + width / 6, top + 5, new StringFormat());
e.Graphics.DrawString(" 日期:" + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(), font, Brushes.Blue, left, top + titlefont.GetHeight(e.Graphics), new StringFormat());
e.Graphics.DrawString(" 操作员:1", font, Brushes.Blue, left + width / 2 + 50, top + titlefont.GetHeight(e.Graphics), new StringFormat());
e.Graphics.DrawString(" 餐品名称 单价 数量 总价", font, Brushes.Black, left, top + titlefont.GetHeight(e.Graphics) + font.GetHeight(e.Graphics), new StringFormat());
lines = ((int)(height - 10 - titlefont.GetHeight(e.Graphics)) - (int)font.GetHeight(e.Graphics)) / (int)font.GetHeight(e.Graphics);
top = top + 10 + titlefont.GetHeight(e.Graphics) + (int)font.GetHeight(e.Graphics) * 2;
int i = 0;
for (i = 0; i < dataset.Tables["SalePrint"].Rows.Count && count < lines; i++)