回复 2楼iceman的帖子
你好,这边保存的Excel的上面合并的字体大小一样大,没有和我当初设置的字体大小一样
这个怎么解决啊??
代码修改后如下:
this.FpSpdCaseNum.Sheets[0].AddSpanCell(0, 0, 1, CellsCount);
this.FpSpdCaseNum.Sheets[0].Cells[0, 0, 0, CellsCount - 1].Text = this.ddlFactory.SelectedItem.ToString();
this.FpSpdCaseNum.Sheets[0].Rows[0].Height = 45;
this.FpSpdCaseNum.Sheets[0].Rows[0].Font.Size = FontUnit.XLarge;
this.FpSpdCaseNum.Sheets[0].Rows[0].Font.Bold = true;
this.FpSpdCaseNum.Sheets[0].Rows[0].HorizontalAlign = HorizontalAlign.Left;
this.FpSpdCaseNum.Sheets[0].Rows[0].VerticalAlign = VerticalAlign.Middle;
this.FpSpdCaseNum.Sheets[0].AddSpanCell(1, 0, 1, 2);
this.FpSpdCaseNum.Sheets[0].AddSpanCell(1, 2, 1, CellsCount - 2);
this.FpSpdCaseNum.Sheets[0].Cells[1, 0, 1, 1].Text = "年份:" + this.datepicker.Text;
this.FpSpdCaseNum.Sheets[0].Cells[1, 2, 1, CellsCount - 1].Text = "成品代码:" + this.ddlProduct.SelectedItem.ToString();
this.FpSpdCaseNum.Sheets[0].Rows[1].Height = 32;
this.FpSpdCaseNum.Sheets[0].Rows[1].Font.Size = FontUnit.Larger;
this.FpSpdCaseNum.Sheets[0].Rows[1].Font.Bold = true;
this.FpSpdCaseNum.Sheets[0].Rows[1].HorizontalAlign = HorizontalAlign.Left;
this.FpSpdCaseNum.Sheets[0].Rows[1].VerticalAlign = VerticalAlign.Middle; |