110,538
社区成员
发帖
与我相关
我的任务
分享
if (circle == 0)
{
// count = 0;
if (!e.HasMorePages)
{
ds = dbTotal.QueryData("select * from Billlist where stant = 'takeaway'", "list");
y = y + 10;
e.Graphics.DrawString("No", new Font("verdana", 8, FontStyle.Regular), Brushes.Black, 0, y, drawFormat1);
x = x + 45;
e.Graphics.DrawString("TbNo", new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y);
x = x + 75;
e.Graphics.DrawString("Time", new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y);
x = x + 130;
e.Graphics.DrawString("Tolprice", new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y, drawFormat);
count++;
x = 2;
y = y + 20;
lineQty = ds.Tables["list"].Rows.Count + 5;
}
while (count < linesPerPage && lineNo < lineQty)
{
if (lineNo < ds.Tables["list"].Rows.Count) //由于lineNo用于表中的下标值,因此需要加上该判断
{
string no = ds.Tables["list"].Rows[lineNo][7].ToString();
string tabno = ds.Tables["list"].Rows[lineNo][5].ToString();
string time = ds.Tables["list"].Rows[lineNo][3].ToString().Substring(0, 10);
string tolprice = ds.Tables["list"].Rows[lineNo][1].ToString();
e.Graphics.DrawString(no, new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y, drawFormat1);
x = x + 50;
e.Graphics.DrawString(tabno, new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y);
x = x + 50;
e.Graphics.DrawString(time, new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y);
x = x + 150;
e.Graphics.DrawString(tolprice, new Font("verdana", 8, FontStyle.Regular), Brushes.Black, x, y, drawFormat);
x = 2;
y = y + 15;
count++;
}
lineNo++;
}
if (lineQty > lineNo)
{
count = 0;
printingPageNo++;
circle = 0;
e.HasMorePages = true;
}
else
{
e.Graphics.DrawString(line6, new Font("verdana", 8, FontStyle.Regular), Brushes.Black, 0, y);//-----线
count++;
e.HasMorePages = false;
}
}