cancel
Showing results for 
Search instead for 
Did you mean: 

Adding column in grid

Former Member
0 Kudos

Hi all,

In SBO report,we have a grid in form that is sbo defined.Can we add a column in it and load it with some values from database,How is it possible?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lalit have u tried using the same code but replacin the oMatrix with a Grid control? I suggest u try it. N as far as the value in this grid comes from your udf. try this:

Dim oGrid As SAPbouiCOM.Grid

oGrid = oForm.Items.Item("<Grid Name>").Specific

Dim oColumns As SAPbouiCOM.Columns

Dim oColumn As SAPbouiCOM.Column

oColumns = oGrid.Columns

oColumn = oColumns.Add("", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.DataBind.SetBound(True, "<SBO Table Name>", "<UDF Column Name>")

The last line of code should solve your problem. You dont have to bother bout taking care of the add update and find functions it will behave like as if wer a system variable. Iv also re-written the code so that you can adapt it to your requirement.

regards

Aris

Answers (2)

Answers (2)

Former Member
0 Kudos

Looking at your previous mails i think you want to add a column to a system form right? Firstly get control of the matrix on the respective system form.

Check out the following code may help you:

oMatrix = oForm.Items.Item("<matrix name>").Specific

oColumns = oMatrix.Columns

oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = "#"

oColumn.Width = 30

oColumn.Editable = False

regards

Aris

Former Member
0 Kudos

Hi Pereira ,

I have to add column in Grid that is at system form,not in matrix.

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Lalit,

Are you asking your question about a Business One report or is you question on how to modify the Business One UI to add a column to a system matrix?

Eddy

Former Member
0 Kudos

Hi Edward,

My question is that ,how do we add column in Grid that is at SBO form and value in this column comes from our UDF?

Regards

Lalit