我在试着从矩阵中读出。到目前为止,我所拥有的代码是:
SAPbouiCOM.Matrix matrix = (SAPbouiCOM.Matrix SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
SAPbouiCOM.Column col = matrix.Columns.Item("1") ;
SAPbouiCOM.Cells cells = col.Cells;
String cell = cells.Item(2).Specific.ToString();
String f = cell.ToString();字符串(cell和f)都没有给出单元格的值...
有什么想法吗?
发布于 2010-05-11 08:52:55
@Miguel试试这段代码
string ColId = "1"; //Set The Column Name to read
Int32 Row = 2; //Set the Row to Read
Matrix oMatrix =(Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific; //Get Access to the Matrix
EditText oEdit =(EditText)oMatrix.Columns.Item(ColId).Cells.Item(Row).Specific; //Cast the Cell of the matrix to the respective type , in this case EditText
string sValue = oEdit.Value; //Get the value form the EditText此外,米格尔还可以在SAP Business One SDK Forum上查看有关SAP B1的任何问题。
发布于 2018-02-13 04:58:19
如果需要从矩阵获取数据,请执行以下操作:
var cellValue =oMatrix.Columns.Item(列Id或索引).Cells.Item(行索引).Specific.Value;
但是如果你需要更新矩阵的值,就必须将
转换为EditText obj,如下所示:
var oEdit = (SAPbouiCOM.EditText)oMatrix.Columns.Item(Column's Id or Index).Cells.Item(Row's Index).Specific;
oEdit.Value = "1";发布于 2012-06-19 15:39:58
SAPbouiCOM.EditText EditValue;
string strValue;
String ColUId = "col_1" // Column UID
Int32 Row = 1 //Row Number
Item item = form.Items.Item("38");
Matrix matrix = ((Matrix)(item.Specific));
EditValue = (SAPbouiCOM.EditText)matrix.GetCellSpecific(ColUId, Row );
strValue = EditValue.Value.ToString().Trim();https://stackoverflow.com/questions/2804922
复制相似问题