日期:2014-05-17 浏览次数:21041 次
for (int j = row; j < data_list.Rows.Count - 1; j++)
{
#region 每条记录的打印数量
//DGV中每条记录的打印数量
for (int p = col; p < int.Parse(data_list.Rows[j].Cells[6].Value.ToString()); p++)
{
col++;
#region 判断DataGridView是否为空
foreach (object cell in data_list.Rows[j].Cells)
{
//判断DataGridView是否为空
DataGridViewCell d = (DataGridViewCell)cell;
if (d.Value == null)
{
MessageBox.Show("数据输入不完整", "错误提示");
return;
}
//取得DATAGRIDVIEW单行的内容
#region
//自动折行计算
if (data_list.Rows[j].Cells[1].Value.ToString().Length > 7)
data_list.Rows[j].Cells[1].Value = data_list.Rows[j].Cells[1].Value.ToString().Substring(0, 6).Trim()+
'\n' + data_list.Rows[j].Cells[1].Value.ToString().Substring(6, 8).Trim() +
'\n' + data_list.Rows[j].Cells[1].Value.ToString().Substring(14, data_list.Rows[j].Cells[1].Value.ToString().Length - 14)).ToString()).Trim();
}