on 09-23-2008 5:57 AM
I wrote a simple Matrix with only 1 row for testing,
here is the code:
oColumn = oColumns.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Vendor"
oColumn.Width = 80
oColumn = oColumns.Add("CardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Name"
oColumn.Width = 100
oMatrix.AddRow(1)
oMatrix.Columns.Item("CardCode").Cells.Item(1).Specific.Value = "AAAAAAAAAA"
oMatrix.Columns.Item("CardName").Cells.Item(1).Specific.value = "BBBBBBBBBB"
The matrix frame is displayed fine, but the content "AAAAAAAAA" and "BBBBBBBBBB" can't be displayed.
Thanks
I changed to:
oMatrix.AddRow(1)
oMatrix.GetLineData(1)
oDataSource1.Value = "AAAAAAAAAAAA"
oDataSource2.Value = "BBBBBBBBBBBB"
oMatrix.SetLineData(1)
it works fine.
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
but the problem stills.
here is the whole parts, please help to check is there something missing.
Private oForm As SAPbouiCOM.Form
Private oItem As SAPbouiCOM.Item
Dim oColumn As SAPbouiCOM.Column
Dim oColumns As SAPbouiCOM.Columns
Dim oMatrix As SAPbouiCOM.Matrix
oForm = SBO_Application.Forms.Add("TEST", SAPbouiCOM.BoFormTypes.ft_Fixed)
oItem = oForm.Items.Add("matrix", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
oItem.Top = 110
oItem.Left = 10
oItem.Width = 670
oItem.Height = 250
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
oColumn = oColumns.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Vendor"
oColumn.Width = 80
oColumn = oColumns.Add("CardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Name"
oColumn.Width = 100
oMatrix.AddRow(1)
Dim edt As SAPbouiCOM.EditText
edt = oMatrix.Columns.Item("CardCode").Cells.Item(1).Specific
edt.String = "AAAAAAAAAA"
edt = oMatrix.Columns.Item("CardName").Cells.Item(1).Specific
edt.String = "BBBBBBBBBB"
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When populating a matrix on a user form, you should use datasources to populate the cells rather than setting the value directly in the control.
Create two userdatasources:
Dim oDataSource1 as SAPbouiCOM.UserDataSource = oForm.DataSources.UserDataSources.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT)
Dim oDataSource2 as SAPbouiCOM.UserDataSource = oForm.DataSources.UserDataSources.Add("CardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
Then bind the datasources to the columns:
oColumn = oColumns.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Vendor"
oColumn.DataBind.SetBound(True, "", "CardCode")
oColumn.Width = 80
oColumn = oColumns.Add("CardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Name"
oColumn.DataBind.SetBound(True, "", "CardName")
oColumn.Width = 100
Finally, use the following code to populate the matrix:
oMatrix.AddRow(1)
oMatrix.GetCurrentLine(0)
oDataSource1.ValueEx = "AAAAAAAAAAAA"
oDataSource2.ValueEx = "BBBBBBBBBBBB"
oMatrix.SetCurrentLine(0)
Kind Regards,
Owen
instead of filling value set .string to
oColumn = oColumns.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Vendor"
oColumn.Width = 80
oColumn = oColumns.Add("CardName", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Name"
oColumn.Width = 100
oMatrix.AddRow(1)
Dim edt As SAPbouiCOM.EditText
edt = oMatrix.Columns.Item("CardCode").Cells.Item(1).Specific
edt.String= "AAAAAAAAAA"
edt = oMatrix.Columns.Item("CardName").Cells.Item(1).Specific
edt.String = "BBBBBBBBBB"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
11 | |
10 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.