public void WriteCell(string cellAddress, object value, string strFont, int size) { _excelRange = _excelSheet.get_Range(cellAddress, _value); //_excelRange = _excelRange.get_Resize(10, 4); _excelRange.set_Value(_value, value); _excelRange.Cells.Font.Name = strFont; _excelRange.Cells.Font.Size = size; }
public void WriteBlock(string startCellAddress, int rowCount, int colCount, object dataBlock) { _excelRange = _excelSheet.get_Range(startCellAddress, _value); _excelRange = _excelRange.get_Resize(rowCount, colCount); _excelRange.set_Value(_value, dataBlock); }
public void WriteBlock(int rowIndex, int colIndex, int rowCount, int colCount, object dataBlock) { _excelRange = _excelSheet.get_Range(GetExcelAddress(colIndex, rowIndex), _value); _excelRange = _excelRange.get_Resize(rowCount, colCount); _excelRange.set_Value(_value, dataBlock); }
public double WriteFieldValue(PointInfo startPoint, PointInfo endPoint, List<List<string>> lists, System.Drawing.Font font) { #region Variable Definition object[] cell = null; object startCell = null; object endCell = null; #endregion cell = this.ConvertPointToCell(startPoint, endPoint); startCell = cell[0]; endCell = cell[1]; objRange = this.CurSheet.get_Range(startCell, endCell); if (startCell.Equals(endCell)) { objRange.set_Value(mValue, lists[0][0]); } else { object[,] objValue = (object[,])objRange.get_Value(mValue); for (int i = 0; i < lists.Count; i++) { List<string> row = lists[i]; int mergeStart = 0; int mergeCount = 1; for (int j = 0; j < row.Count; j++) { //merge cell���� if (row[j] != null && row[j].Equals(ExcelReportExporter.MERGE_CELL)) { objValue[i + 1, j + 1] = string.Empty; mergeCount++; } else { if (mergeCount > 1) { //merge Merge(new PointInfo(startPoint.RowIndex + i, mergeStart), new PointInfo(startPoint.RowIndex + i, mergeStart + mergeCount - 1)); mergeCount = 1; } objValue[i + 1, j + 1] = row[j]; mergeStart = j; } if (j == row.Count - 1 && mergeCount > 1) { //merge Merge(new PointInfo(startPoint.RowIndex + i, mergeStart), new PointInfo(startPoint.RowIndex + i, mergeStart + mergeCount - 1)); } } } objRange.set_Value(mValue, objValue); } SetFont(startPoint, endPoint, font); return (double)objRange.Height; }
public void WriteCell(string cellAddress, object value) { _excelRange = _excelSheet.get_Range(cellAddress, _value); //_excelRange = _excelRange.get_Resize(10, 4); _excelRange.set_Value(_value, value); _excelRange.Cells.Font.Name = "Calibri"; _excelRange.Cells.Font.Size = 10; }