Hi,
I just wrapped text in the merged cells in the worksheet. I just set center to the vertical cell alignment of the merged cells. Below is my code
range = worksheet.MergedCellsRegions.Add(headerRow + rowindex + ExistingRows, colindex + ExistingColumns, headerRow + rowindex + MaxRows + ExistingRows, colindex + MaxColumns + ExistingColumns)
With range .CellFormat.Alignment = HorizontalCellAlignment.Center 'change to alignment of a cell so the value is centered in the cell. .CellFormat.WrapText = ExcelDefaultableBoolean.True .CellFormat.VerticalAlignment = VerticalCellAlignment.Center .Value = value 'set value to range of the worksheet End With
However I got an error below
System.MissingMethodException was unhandled by user code HResult=-2146233069 Message=Method not found: 'Void Infragistics.Documents.Excel.IWorksheetCellFormat.Add(Infragistics.Documents.Excel.NamedReference)'. StackTrace: at GenerateExcel(DataGrid dg, Workbook workbook) at HTMLReport.GetReport(HttpResponse response) InnerException:
Infragistics4.WebUI.Documents.Excel.v14.1
v4.0.30319
Please let me know if i am missing something.
Thanks,
Chi Ming
It looks like you have some code that originally compiled a call to IWorksheetCellFormat.Add(NamedReference), but then can't find it at runtime. However, no such method has ever been defined on the IWorksheetCellFormat interface. Have you compiled against custom code? Can you provide a sample which demonstrates the issue?