Skip to Content
author's profile photo Former Member
Former Member

Display data to matrix using LoadFromDataSource

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2005 at 12:38 PM

    Hello.

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

    By.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.