官方QQ:  16643506

TdxSpreadSheet 取单元格的值

  1. functionTfrmQuotaImportMainMaterial.GetCellValue(ARow,ACol:Integer):Variant;

  2. var

  3.    vMergeCell:TdxSpreadSheetMergedCell;

  4. begin

  5.    vMergeCell := dxsprdshtContent.ActiveSheetAsTable.MergedCells.FindCell(ARow,ACol);

  6. ifAssigned(vMergeCell)then

  7. begin

  8. if dxsprdshtContent.ActiveSheetAsTable.Cells[vMergeCell.Area.Top, vMergeCell.Area.Left].IsFormulathen

  9. Result:=XLSRead.Sheets[dxsprdshtContent.ActiveSheetIndex].AsString[FNameCol,FCurrentRow].Trim

  10. else

  11. Result:= dxsprdshtContent.ActiveSheetAsTable.Cells[vMergeCell.Area.Top, vMergeCell.Area.Left].AsString;

  12. end

  13. elseifnot dxsprdshtContent.ActiveSheetAsTable.Cells[ARow,ACol].IsEmptythen

  14. Result:= dxsprdshtContent.ActiveSheetAsTable.Cells[ARow,ACol].AsVariant

  15. else

  16. Result:='';

  17. end;


联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678