本帖最后由 lgxl6925 于 2017-2-3 10:59 编辑
FarPoint.Web.Spread.TextCellType t = new FarPoint.Web.Spread.TextCellType();
t.Multiline = true;
string drsg = "当日施工、维修情况:" + "\r\n";
string qrsg = "前日施工、维修情况:" + "\r\n";
string aqzd = "安全重点信息:" + "\r\n";
string srzd = "上日重点工作布置落实:" + "\r\n";
string crgzzd = "次日工作重点布置落实:" + "\r\n";
string lczwdxx = "列车正晚点信息:" + "\r\n";
string bz = "备注:" + "\r\n";
for (int i = 0; i < ds.Tables["temp_table"].Rows.Count; i++)
{
drsg = drsg + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[16].ToString() + "\r\n";
qrsg = qrsg + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[17].ToString() + "\r\n";
aqzd = aqzd + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[18].ToString() + "\r\n";
srzd = srzd + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[19].ToString() + "\r\n";
crgzzd = crgzzd + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[20].ToString() + "\r\n";
lczwdxx = lczwdxx + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[21].ToString() + "\r\n";
bz = bz + (i + 1).ToString() + "." + ds.Tables["temp_table"].Rows[1].ToString() + ":" + ds.Tables["temp_table"].Rows[22].ToString() + "\r\n";
}
FpSpread1.Sheets[0].Cells[17, 0].Text = "4";
FpSpread1.Sheets[0].AddSpanCell(17, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[17, 1].CellType = t;
FpSpread1.Sheets[0].Cells[17, 1].Text = lczwdxx;
FpSpread1.Sheets[0].Cells[18, 0].Text = "5";
FpSpread1.Sheets[0].AddSpanCell(18, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[18, 1].CellType = t;
FpSpread1.Sheets[0].Cells[18, 1].Text = drsg;
FpSpread1.Sheets[0].Cells[19, 0].Text = "6";
FpSpread1.Sheets[0].AddSpanCell(19, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[19, 1].CellType = t;
FpSpread1.Sheets[0].Cells[19, 1].Text = qrsg;
FpSpread1.Sheets[0].Cells[20, 0].Text = "7";
FpSpread1.Sheets[0].AddSpanCell(20, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[20, 1].CellType = t;
FpSpread1.Sheets[0].Cells[20, 1].Text = aqzd;
FpSpread1.Sheets[0].Cells[21, 0].Text = "8";
FpSpread1.Sheets[0].AddSpanCell(21, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[21, 1].CellType = t;
FpSpread1.Sheets[0].Cells[21, 1].Text = srzd;
FpSpread1.Sheets[0].Cells[22, 0].Text = "9";
FpSpread1.Sheets[0].AddSpanCell(22, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[22, 1].CellType = t;
FpSpread1.Sheets[0].Cells[22, 1].Text = crgzzd;
FpSpread1.Sheets[0].Cells[23, 0].Text = "10";
FpSpread1.Sheets[0].AddSpanCell(23, 1, 1, ls - 1); ;//合并单元格
FpSpread1.Sheets[0].Cells[23, 1].CellType = t;
FpSpread1.Sheets[0].Cells[23, 1].Text = bz;
|