on 04-28-2006 2:11 PM
Hallo all. sorry for my english
question: how add data from user table (sample @TABLE) into then matrix?
Please give the programm code
Very Thanks from Moscow, Russia
Hello Artem,
try this codes in VB6:
Public Sub BindDataToForm()
'//********************************************************
'// binding data to the Form items will set the connection
'// between the requested DB table field and the item
'//********************************************************
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumns As SAPbouiCOM.Columns
Dim oColumn As SAPbouiCOM.Column
'// getting the form's matrix object
Set oMatrix = oForm.Items.Item("Matrix1").Specific
Set oColumns = oMatrix.Columns
'// getting the matrix columns by the UID
Set oColumn = oColumns.Item("UserName")
'// bindidng the data
oColumn.DataBind.SetBound True, "OUSR", "U_NAME"
Set oColumn = oColumns.Item("UserEmail")
oColumn.DataBind.SetBound True, "OUSR", "E_Mail"
Set oColumn = oColumns.Item("UserPhone")
oColumn.DataBind.SetBound True, "OUSR", "PortNum"
Set oColumn = oColumns.Item("Remarks")
'//************************************************
'// to Data Bind an item with a user Data source
'// the table name value should be an empty string
'//************************************************
oColumn.DataBind.SetBound True, "", "Remarks"
End Sub
Public Sub GetDataFromDataSourec()
Dim oDBDataSource As SAPbouiCOM.DBDataSource
Dim oUserDataSource As SAPbouiCOM.UserDataSource
Dim oMatrix As SAPbouiCOM.Matrix
Dim i As Long '// to be used as counter
'// getting the data sources from the form
Set oDBDataSource = oForm.DataSources.DBDataSources.Item("OUSR")
Set oUserDataSource = oForm.DataSources.UserDataSources.Item("Remarks")
'// getting the matrix from the form
Set oMatrix = oForm.Items.Item("Matrix1").Specific
oMatrix.Clear
'// Querying the DB Data source
oDBDataSource.Query
'// setting the user data source data
oUserDataSource.Value = "Your remarks here ..."
For i = 0 To oDBDataSource.Size - 1
oDBDataSource.Offset = i
oMatrix.AddRow
Next i
oMatrix.AutoResizeColumns
End Sub
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just give databound to true in XML like this....
<column uid="colUID" type="16" title="Item Description" description="" visible="1" AffectsFormMode="1" width="133" disp_desc="0" editable="0" right_just="0" val_on="Y" val_off="N" backcolor="-1" forecolor="-1" text_style="0" font_size="-1">
<databind databound="1" table="@DetailTableName" alias="U_FieldName"/>
<ExtendedObject/>
</column>
Hello Artem,
You can create a DBDatasource object in DI API to bind the User Defined Table into the matrix. Try to look on the examples provided by SBO. Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.