Skip to Content
author's profile photo
Former Member

Adding column in grid

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 08:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 17, 2007 at 08:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 05:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded