cancel
Showing results for 
Search instead for 
Did you mean: 

Display data to matrix using LoadFromDataSource

Former Member
0 Kudos

Hello all,

I tried to display data to matrix.

I used matrix object's LoadFromDatasouce.

But it didn't display data at all.

Pls help me!!

creationPackage.ObjectType = "EVOSS_BUSTR"

creationPackage.UniqueID = "TEST

creationPackage.FormType = "TEST"

creationPackage.BorderStyle = SAPbouiCOM.BoFormTypes.ft_Fixed

Set oForm = SBO_Application.Forms.AddEx(creationPackage)

sTableName = "@EVOSS_BUSTR"

oForm.Title = sTitle

oForm.Height = 300

oForm.Width = 350

oForm.DataSources.DBDataSources.Add ("sTableName")

Set oItem = oForm.Items.Add("1", it_BUTTON)

oItem.Left = 5

oItem.Width = 65

oItem.Top = 240

oItem.Height = 19

Set oButton = oItem.Specific

oButton.Type = bt_Caption

Set oItem = oForm.Items.Add("2", it_BUTTON)

oItem.Left = 75

oItem.Width = 65

oItem.Top = 240

oItem.Height = 19

Set oButton = oItem.Specific

oButton.Type = bt_Caption

'Adding a matrix

Set oItem = oForm.Items.Add("TEST, it_MATRIX)

oItem.Left = 5

oItem.Width = 340

oItem.Top = 10

oItem.Height = 200

oItem.AffectsFormMode = True

Set oMatrix = oItem.Specific

Set oColumns = oMatrix.Columns

'Adding col 1

Set oColumn = oColumns.Add("ColNb", it_EDIT)

oColumn.TitleObject.Caption = "#"

oColumn.Width = 20

oColumn.Editable = False

'oColumn.DataBind.SetBound True, "", "#"

'Adding col 2

Set oColumn = oColumns.Add("EVOSS_Code", it_EDIT)

oColumn.TitleObject.Caption = "Code"

oColumn.Width = 80

oColumn.Editable = True

oColumn.DataBind.SetBound True, sTableName, "Code"

'Adding col 3

Set oColumn = oColumns.Add("EVOSS_Name", it_EDIT)

oColumn.TitleObject.Caption = "Name"

oColumn.Width = 220

oColumn.Editable = True

oColumn.DataBind.SetBound True, sTableName, "Name"

oMatrix.AddRow

Set oColumn = oMatrix.Columns.Item("EVOSS_Code")

Set eItemCode = oColumn.Cells.Item(1).Specific

' oForm.Mode = fm_FIND_MODE

' oForm.DataBrowser.BrowseBy = "EVOSS_Code"

'oMatrix.SelectionMode = ms_None

oForm.Visible = True

add_line = True

oMatrix.LoadFromDataSource

View Entire Topic
Former Member
0 Kudos

Hello.

For load a data to a matrix you need call a Query method of the dbdatasource to obtain data from the database.

By.