日期:2014-05-17  浏览次数:20887 次

打印换页,没有数据
int x, y;
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.HasMorePages = false;
            y += 260;
            x = 20;

            for (rows = rows; rows < myds.Tables[0].Rows.Count;rows++)  //我的数据有108条
            {
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["DetailsID"].ToString();, new Font("宋体", 12), Brushes.Black, x, y);
                x = 80;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["AreaMedian"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 180;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["LocationMedian"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 230;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["SegmentNumber"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 280;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["FaceBit"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 380;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["Department"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 480;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["SKU"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 650;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["SellingPrice"].ToString(), new Font("宋体", 12), Brushes.Black, x, y);
                x = 750;
                e.Graphics.DrawString(myds.Tables[0].Rows[rows]["Num"].ToString(), new Font("宋体",&nb