Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Issue with vertical cell alignment after cells are being merged and wrapped.
posted

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

Parents
No Data
Reply
  • 44743
    posted

    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?

Children
No Data