ValueEx versus Value (Matrix UserDataSource)

If I add a new line to a Matrix and clear the value of a number column using :
dsQuantity.ValueEx = "";
I receive this error
Data Source - Invalid field value  [66000-19]
However, I can successfully clear the column's cell using the method of Value (Deprecated in UI API 2004):
dsQuantity.Value = "";
Any idea how I can clear the cell of any text when the data source is set as dt_LONG_NUMBER ?
Regards,
Pat Read

Hi Patrick,
Those are properties of the UserDataSource object, not the Matrix or Column objects.
What UI API are you referencing in your project?
Any idea how I can clear the cell of any text when the data source is set as dt_LONG_NUMBER ?
Just put the value 0 in the UserDataSource and change the EditText control's SuppressZeros property to True.
oForm.DataSources.UserDataSource.Item("dsQuantity").ValueEx = "0"
oForm.Items.Item("Quantity").Specifiec.d.SuppressZeros = True
Regards,
Vítor Vieira

Similar Messages

  • Unexpected value matrix(1,0,0,1,NaN,NaN) parsing transform attribute Anychart

    We are running Oracle Apex 4.2 and whenever a user creates a new session,  the chart on the home page shows the No Data Found Message. However, when you refresh or submit the page, the correct data and rendering appears. On the initial page load, the only message in the Javascript Console is a warning "Unexpected value matrix(1,0,0,1,NaN,NaN) parsing transform".
    We attempted an on load refresh dynamic action but that does not work as well.
    What could this be?
    Thanks.

    The error:
    gethydrosdi.xsl<Line 22, Column 40>:
    XML-0137: (Error) Attribute 'select' used but not declared.is caused by trying to parse your XSLT stylesheet using an XML parser which has been set to use DTD validation.
    The follow example illustrates a program that causes your error to appear. Given the file 'foo.dtd':
    <!ELEMENT foo EMPTY>and the file 'foo.xml':
    <?xml version="1.0"?>
    <!DOCTYPE foo SYSTEM "foo.dtd">
    <foo/>and the stylesheet 'foo.xsl':
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>The following Java program illustrates producing your error:
    import oracle.xml.parser.v2.*;
    import java.io.*;
    import org.w3c.dom.*;
    public class ex {
    public static void main(String[] a) throws Throwable {
    DOMParser d = new DOMParser();
    d.setValidationMode(true);
    d.parseDTD(new FileReader("foo.dtd"),"foo");
    d.setDoctype(d.getDoctype());
    d.parse(new FileReader("foo.xml"));
    d.parse(new FileReader("foo.xsl"));
    XMLDocument doc = (XMLDocument)d.getDocument();
    doc.print(System.out);
    }If you run this with the command:
    java exfrom the directory where foo.xml, foo.dtd, and foo.xsl are, you'll get the error:
    Element 'xsl:stylesheet' used but not declared.The following code illustrates the way to avoid the error, by setting validation mode to false before trying to parse the stylesheet:
    import oracle.xml.parser.v2.*;
    import java.io.*;
    import org.w3c.dom.*;
    public class ex {
    public static void main(String[] a) throws Throwable {
    DOMParser d = new DOMParser();
    d.setValidationMode(true);
    d.parseDTD(new FileReader("foo.dtd"),"foo");
    d.setDoctype(d.getDoctype());
    d.parse(new FileReader("foo.xml"));
    // Set the validation mode to false before using
    // the same instance of a DOMParser to parse the stylesheet.
    d.setValidationMode(false);
    d.parse(new FileReader("foo.xsl"));
    XMLDocument doc = (XMLDocument)d.getDocument();
    doc.print(System.out);
    }null

  • Update Value Matrix

    Hi a need a help
    I have a matrix and want a update a value of one cell.
    I Try this:
    oColumn = oColumns.Add("Col", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    oColumn.TitleObject.Caption = "Cód. Mun. SAP";
    oColumn.Width = 40;
    oColumn.Editable = true;
    oColumn.DataBind.SetBound(true, "@Table", "U_Col");
    oMatrix.FlushToDataSource();
    oDBDataSource = oForm.DataSources.DBDataSources.Item("@Table");
    oDBDataSource.SetValue("U_Col", 10, NewValue);
    oMatrix.LoadFromDataSource();
    The new value is show in Matrix but when click in update the new value not update.

    Hi Dear,
    Please try this..
    oColumn = oColumns.Add("Col", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    oColumn.TitleObject.Caption = "Cód. Mun. SAP";
    oColumn.Width = 40;
    oColumn.Editable = true;
    oColumn.DataBind.SetBound(true, "@Table", "U_Col");
    oMatrix.FlushToDataSource();
    oDBDataSource = oForm.DataSources.DBDataSources.Item("@Table");
    oMatrix.LoadFromDataSource();
    oDBDataSource.SetValue("U_Col", 10, NewValue);
    Hope this will help you..
    lg Mahendra

  • UKMS versus Value Mapping versus Z tables ?

    Hello,
    has someone already made a choice whether to use UKMS or Value Mapping or Z Tables to do mapping or filtering of data ?
    If yes, what were the reasons to go for one or the other solution ?
    - both UKMS / Value Mapping provide key-pair mappings
    - UKMS can be called via RFC or out of XSLT. (Out of User-Defined function I am not sure)
    - Value Mapping can at least be called out of graphical mapping
    - the UKMS / Value Mapping approach looks very similar to me.
    - Z Tables might be more flexibel in defining the structure required
    - is there a caching advantage in one of these solutions ?
    many thx in advance
    Uwe

    Hi Uwe Knöfel ,
    has someone already made a choice whether to use UKMS or Value Mapping or Z Tables to do mapping or filtering of data ?
    Usually YES, XI Architect will decide what to follow..
    If yes, what were the reasons to go for one or the other solution ?
    Mostly it depends upon Complexity,Kind and Volume of data.Suppose there is less volume of data and simple processing is needed we may go for Value mapping than Ztables.
    + is there a caching advantage in one of these solutions ?+
    May not..
    Regards,
    Ramesh

  • New value in Matrix

    Hi all,
    how to add a new row in a matrix not bounded to a datasource?
    I tried to retrieve a cell and set the cell.value property, but doesn't work (the values doesn't appear).
    Any example is appreciated.
    thank's
    danilo

    Hi Bat Dan
    You have to bound the matrix to some sourt of datasource. If you don't it will not retain the data. The datasource serv es as a container for the data. You must use either a userdatasource or dbdatasource.
    -DBdatasource is linked to table.
    -Userdatsource is not linked to a table, just binded to edittext or matrix to hold data.
    'You must add a datasource
    oForm.DataSources.UserDataSources.Add("DataID", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
    'then bind it to a column
    oMatrix = oForm.Items.Item("ComMat").Specific
    oColumns = oMatrix.Columns
    oColumn = oColumns.Item("ColumnID")
    oColumn.DataBind.SetBound(True, "", "DataID")
    'Then add a row to the matrix
    omatrix.addrow
    'Know you can add values to the matrix, you can do
    'it via the datasource or the cell in the
    'matrix           
    'userdatasource way
    oForm.DataSources.UserDataSources.Item("UserdatasourceID").Value = Value
    oform.update
    'cell way
    Dim oEdit As SAPbouiCOM.EditText
    oEdit = oColumns.Item("ColumnID").Cells.Item(RowNum).Specific
    oEdit.Value = i
    Hope this helps

  • How to calculate mean value of a matrix

    Hi... I ve one matrix of order (m*n). I need to calculate the mean value of this matrix. How to do this?
    let we consider the matrix as 4x4.(Row=Column=4) The resultant matrix i.e mean value matrix is 1x4(Row=4,Column=1). To read the row value simultaneously in order to calculte the mean value thro row.... ?  please help me out
    Example:
    Matrix A=1 2 3 4
                   5 6 7 8
                   1 3 5 7
                   2 4 6 8. 
    Mean value thro row would be:   10/4 [  (1+2+3+4)/4
                                                      26/4 [ (5+6+7+8) /4...Like this i ve to do..
    Please help me out

    Hi,
      See this attachment.....
    Thanks and regards,
    srikrishnaNF
    Attachments:
    Example_VI_BD.png ‏3 KB

  • Child value is not updated?

    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim i As Integer
            Dim sumdepth As Decimal = 0
            Dim oForm As SAPbouiCOM.Form
            Dim Matrix As SAPbouiCOM.Matrix
            oForm = SBO_Application.Forms.Item(FormUID)
            Select Case pVal.EventType
                Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                    '// Check if the event was raised by one of the Folder items
                    '// and change the form's pane level
                Case SAPbouiCOM.BoEventTypes.et_CLICK
                    If pVal.ItemUID = "1" And pVal.BeforeAction = True Then
                        If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then
                            'If Validation() = False Then
                            If oForm.Items.Item("OrdrVal").Specific().Value = "" Then
                                BubbleEvent = False
                                'SBO_Application.MessageBox(" Please Enter  The Order No ")
                                SBO_Application.StatusBar.SetText("Enter The  Order  No- 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Items.Item("OrdrVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                                Exit Sub
                            End If
                            If oForm.Items.Item("LocVal").Specific().Value = "" Then
                                BubbleEvent = False
                                ' SBO_Application.MessageBox(" Please Enter  The Location ")
                                SBO_Application.StatusBar.SetText("Enter The  Location - 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Items.Item("LocVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                                Exit Sub
                            End If
                            If oForm.Items.Item("SupVal").Specific().Value = "" Then
                                BubbleEvent = False
                                ' SBO_Application.MessageBox(" Please Enter  The Location ")
                                SBO_Application.StatusBar.SetText("Enter The  Supervisor - 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Items.Item("SupVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                                Exit Sub
                            End If
                            Matrix = oForm.Items.Item("Matrix1").Specific
                            If Matrix.Columns.Item("Depth").Cells.Item(1).Specific.Value = "" Then
                                BubbleEvent = False
                                ' SBO_Application.MessageBox(" Please Enter  The Location ")
                                SBO_Application.StatusBar.SetText("Enter The  Depth - 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                ' oForm.Items.Item("Depth").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                                Exit Sub
                            End If
                            'Dim sSQL As String
                            'Dim logno As Integer
                            ''sSQL = "SELECT COUNT(DocEntry)AS count FROM [@OOBR]"
                            'sSQL = "SELECT Max(DocEntry)AS count FROM [@OOBR]"
                            'oLineRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                            'oLineRec.DoQuery(sSQL)
                            'logno = CInt(oLineRec.Fields.Item(0).Value) + 1
                            'oForm.Items.Item("LogVal").Specific().Value = logno
                        End If
                    End If
            End Select
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                'SBO_Application.MessageBox(oCFL)
                If oCFLEvento.BeforeAction = False Then
                    Dim oDataTable As SAPbouiCOM.DataTable
                    oDataTable = oCFLEvento.SelectedObjects
                    ShowValue(pVal, oDataTable, oForm)
                End If
            End If
            Matrix = oForm.Items.Item("Matrix1").Specific
            If ((pVal.ItemUID = "Matrix1") And (pVal.Row = Matrix.RowCount) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then
                Matrix.AddRow(1, -1)
                Matrix.Columns.Item("#").Cells.Item(Matrix.RowCount).Specific.Value = Matrix.RowCount
            End If
            If ((pVal.FormUID = "SM_OBRFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Or (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then
                For i = 1 To Matrix.RowCount
                    sumdepth += Matrix.Columns.Item("Depth").Cells.Item(i).Specific.Value
                    oForm.Items.Item("DepthVal").Specific().value = sumdepth
                    Dim oDocRec As SAPbobsCOM.Recordset
                    Dim sSQL As String
                    If oDocRec.RecordCount > 0 Then
                        sSQL = ""
                        Dim UpdateRec As SAPbobsCOM.Recordset
                        UpdateRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        UpdateRec.DoQuery(sSQL)
                    End If
                Next
            End If
            If (FormUID = "SM_OBRFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) Then
                Windows.Forms.Application.Exit()
            End If
        End Sub
        Private Sub SalesOrdrCFL(ByVal oForm As SAPbouiCOM.Form)
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                'Dim oCons As SAPbouiCOM.Conditions
                'Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "17"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                oCFLCreationParams.UniqueID = "CFL2"
                oCFL = oCFLs.Add(oCFLCreationParams)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
    error   data already exist in child table

    Imports System
    Imports System.web
    Imports System.Windows.Forms.Form
    Public Class SM_DPSFM
        '// At the begining of every UI API project we should first
        '// establish connection with a running SBO application.
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private oForm As SAPbouiCOM.Form
        Dim oButton As SAPbouiCOM.Button
        Dim oOptionBtn As SAPbouiCOM.OptionBtn
        Dim oCheckBox As SAPbouiCOM.CheckBox
        Dim oComboBox As SAPbouiCOM.ComboBox
        Dim oItem As SAPbouiCOM.Item
        Dim oStatic As SAPbouiCOM.StaticText
        Dim oEdittext As SAPbouiCOM.EditText
        Dim oEditItem As SAPbouiCOM.EditText
        Private oMatrix As SAPbouiCOM.Matrix
        Private Matrix2 As SAPbouiCOM.Matrix
        Private oLink As SAPbouiCOM.LinkedButton
        Private oColumns As SAPbouiCOM.Columns
        Private oColumn As SAPbouiCOM.Column
        Private sPath As String
        Private oDBDataSource As SAPbouiCOM.DBDataSource
        Private oCompany As SAPbobsCOM.Company
        Private rs As SAPbobsCOM.Recordset
        Private oLineRec As SAPbobsCOM.Recordset
        Private rs1 As SAPbobsCOM.Recordset
        '// declaring a User data source for the "Remarks" Column
        Private oUserDataSource As SAPbouiCOM.UserDataSource
        Public sErrMsg As String
        Public lErrCode As Long
        Public lRetCode As Long
        Private Sub SetApplication()
            '// Use an SboGuiApi object to establish the connection
            '// with the application and return an initialized appliction object
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            '// by following the steps specified above, the following
            '// statment should be suficient for either development or run mode
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            '// connect to a running SBO Application
            SboGuiApi.Connect(sConnectionString)
            '// get an initialized application object
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Private Sub AddMenuItems()
            '// Let's add a pop-up menu item and 2 sub menu items
            Dim oMenus As SAPbouiCOM.Menus               '//  use the following object to add menu
            Dim oMenuItem As SAPbouiCOM.MenuItem
            '// Get the menus collection from the application
            oMenus = SBO_Application.Menus
            Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
            oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
            oMenuItem = SBO_Application.Menus.Item("43520") 'moudles'
            sPath = System.Windows.Forms.Application.StartupPath()
            sPath = sPath.Remove(sPath.Length - 3, 3)
            '' Creation parameters
            oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
            oCreationPackage.UniqueID = "SM_DMID"
            oCreationPackage.String = "Dealer Mgmt."
            'oCreationPackage.Image = sPath & "dealermg.gif"
            oCreationPackage.Image = IO.Directory.GetParent(Application.StartupPath).ToString & "\CFL.BMP"
            '' we add our menu at the buttom of the list
            oCreationPackage.Position = oMenuItem.SubMenus.Count + 1
            oMenus = oMenuItem.SubMenus
            Try ' If the menu already exists this code will fail
                oMenus.AddEx(oCreationPackage)
                '' Get the menu collection of the newly added pop-up item
                oMenuItem = SBO_Application.Menus.Item("SM_DMID")
                oMenus = oMenuItem.SubMenus
                '' Add Sub Menu Items
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
                oCreationPackage.UniqueID = "SM_DPSMENU"         ''Unique ID of 1st Sub Menu item
                oCreationPackage.String = "Dumper Performance Sheet"
                oMenus.AddEx(oCreationPackage)
            Catch er As Exception ' Error Handling
                SBO_Application.MessageBox(er.Message)
            End Try
        End Sub
        'Private Sub AddMenuItems()
        '    '// Let's add a pop-up menu item and 2 sub menu items
        '    Dim oMenus As SAPbouiCOM.Menus               '//  use the following object to add menu
        '    Dim oMenuItem As SAPbouiCOM.MenuItem
        '    '// Get the menus collection from the application
        '    oMenus = SBO_Application.Menus
        '    Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
        '    oMenuItem = SBO_Application.Menus.Item("SM_DMID")
        '    sPath = System.Windows.Forms.Application.StartupPath()
        '    sPath = sPath.Remove(sPath.Length - 3, 3)
        '    oMenus = oMenuItem.SubMenus
        '    Try ' If the menu already exists this code will fail
        '        '' Add Sub Menu Items
        '        oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
        '        oCreationPackage.UniqueID = "SM_DPSMENU"
        '        oCreationPackage.String = "Dumper Performance Sheet"
        '        oCreationPackage.Position = 1
        '        oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
        '        oMenuItem = oMenus.AddEx(oCreationPackage)
        '    Catch er As Exception ' Error Handling
        '        SBO_Application.MessageBox(er.Message)
        '    End Try
        'End Sub
        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            If pVal.BeforeAction = False Then
                Select Case pVal.MenuUID
                    Case "SM_DPSMENU"
                        diplay_DPSform() ''Function to display 1st Sub Menu item (D.P.S.) form.
                End Select
            End If
        End Sub
        'Function to draw the Dumper Performance Sheet.
        Private Sub diplay_DPSform()
            Dim oForm As SAPbouiCOM.Form
            Dim val1 As String
            Try
                oForm = SBO_Application.Forms.Item("SM_DPSFM")
                SBO_Application.MessageBox("Form Already Open")
            Catch ex As Exception
                Dim fcp As SAPbouiCOM.FormCreationParams
                fcp = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
                fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
                fcp.FormType = "SM_DPSFM"
                fcp.ObjectType = "SM_DPS"
                fcp.UniqueID = "SM_DPSFM"
                fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                oForm = SBO_Application.Forms.AddEx(fcp)
                oForm.AutoManaged = False
                SalesOrdrCFL(oForm)             ''Function to see the list of Sales Orders.
                'OBRCFL(oForm)
                itemlist(oForm)
                DrawDPSForm(oForm)
                ''Function to Draw the form for 1st Sub Menu
            End Try
            oForm.DataBrowser.BrowseBy = "DpsVal"
            oForm.Visible = True
        End Sub
        ''Function to Draw the form for Sub Menu
        Private Sub DrawDPSForm(ByVal oForm As SAPbouiCOM.Form)
            Dim oItem As SAPbouiCOM.Item
            Dim oButton As SAPbouiCOM.Button
            Dim oEdittext As SAPbouiCOM.EditText
            Dim val As String
            ''Form specifications
            oForm.Title = "Dumper Performance Sheet"
            oForm.Left = 320 '340
            oForm.ClientWidth = 550 '350
            oForm.Top = 100
            oForm.ClientHeight = 422 '393
            'Adding a datasource to the form
            oDBDataSource = oForm.DataSources.DBDataSources.Add("@ODPS")
            ''Order Text
            oItem = oForm.Items.Add("OrdrTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 100
            oItem.Top = 10
            ' oItem.AffectsFormMode = False
            oItem.LinkTo = "OrdrVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Order No."
            ''Order Date Text
            oItem = oForm.Items.Add("OrdrdtTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 100
            oItem.Top = 27
            oItem.AffectsFormMode = False
            oItem.LinkTo = "OrdrdtVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Order Date"
            ''Customer Text Box
            oItem = oForm.Items.Add("CustTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 100
            oItem.Top = 44
            oItem.AffectsFormMode = False
            oItem.LinkTo = "CustVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Customer Name"
            ''DPS Text
            oItem = oForm.Items.Add("DpsTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290 '271
            oItem.Width = 50  '100
            oItem.Top = 10
            oItem.AffectsFormMode = False
            oItem.LinkTo = "DpsVal"
            oStatic = oItem.Specific
            oStatic.Caption = "DPS No."
            ''DPS Date
            oItem = oForm.Items.Add("DateTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 50 '100
            oItem.Top = 27
            oItem.AffectsFormMode = False
            oItem.LinkTo = "DateVal"
            oStatic = oItem.Specific
            oStatic.Caption = "DPS Date"
            ''Log No. Text
            oItem = oForm.Items.Add("LogTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5 '290
            oItem.Width = 100 '50 '100
            oItem.Top = 61
            oItem.AffectsFormMode = False
            oItem.LinkTo = "LogVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Log No."
            ''SuperVisor Text
            oItem = oForm.Items.Add("SupTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 100
            oItem.Top = 300
            oItem.AffectsFormMode = False
            oItem.LinkTo = "SupVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Supervisor"
            ''Total Trip for S/M Text
            oItem = oForm.Items.Add("Trip1Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 140 '100
            oItem.Top = 300
            oItem.AffectsFormMode = False
            oItem.LinkTo = "Trip1Val"
            oStatic = oItem.Specific
            oStatic.Caption = "Total Trips Made For S/M"
            ''Remarks Text
            oItem = oForm.Items.Add("RmksTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 50 '100
            oItem.Top = 320
            oItem.AffectsFormMode = False
            oItem.LinkTo = "RmksVal"
            oStatic = oItem.Specific
            oStatic.Caption = "Remarks"
            ''Total Trip for LATERITE Text
            oItem = oForm.Items.Add("Trip2Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 140 '100
            oItem.Top = 320
            oItem.AffectsFormMode = False
            oItem.LinkTo = "Trip2Val"
            oStatic = oItem.Specific
            oStatic.Caption = "Total Trips Made For LAT"
            ''Total Trip for BAUXITE Text
            oItem = oForm.Items.Add("Trip3Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 140 '100
            oItem.Top = 340
            oItem.AffectsFormMode = False
            oItem.LinkTo = "Trip3Val"
            oStatic = oItem.Specific
            oStatic.Caption = "Total Trips Made For BAUX "
            ''Total Trip for Item4 Text
            oItem = oForm.Items.Add("Trip4Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 140 '100
            oItem.Top = 360
            oItem.AffectsFormMode = False
            oItem.LinkTo = "Trip4Val"
            oStatic = oItem.Specific
            oStatic.Caption = "Total Trips Made For Itm4"
            ''Total Trip for Item5 Text
            oItem = oForm.Items.Add("Trip5Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 290
            oItem.Width = 140 '100
            oItem.Top = 380
            oItem.AffectsFormMode = False
            oItem.LinkTo = "Trip5Val"
            oStatic = oItem.Specific
            oStatic.Caption = "Total Trips Made For Itm5"
            'oItem = oForm.Items.Add("Txt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            'oItem.Left = 106
            'oItem.Width = 4
            'oItem.Top = 10
            '' oItem.AffectsFormMode = False
            ''oItem.LinkTo = "OrdrVal" '"Vndval"
            'oStatic = oItem.Specific
            ''oStatic.Caption = "Order No."
            'oLink = oItem.ExtendedObject '// new property
            'oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Order
            Dim oEditlogdt As SAPbouiCOM.EditText
            ' Dim oEdittype As SAPbouiCOM.EditText
            'Dim oEditloc As SAPbouiCOM.EditText
            Dim oEditordr As SAPbouiCOM.EditText
            Dim oEditorddt As SAPbouiCOM.EditText
            Dim oEditcust As SAPbouiCOM.EditText
            Dim oEditdep As SAPbouiCOM.EditText
            Dim oEditsup As SAPbouiCOM.EditText
            Dim oEditrmrk As SAPbouiCOM.EditText
            Dim val1 As String
            Dim sSQL As String
            Dim logno As Integer
            sSQL = "SELECT Max(DocEntry)AS count FROM [@ODPS]"
            oLineRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            oLineRec.DoQuery(sSQL)
            logno = CInt(oLineRec.Fields.Item(0).Value) + 1
            ''DPS No. Edit Box
            oItem = oForm.Items.Add("DpsVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 376
            oItem.Width = 160
            oItem.Top = 10
            oItem.AffectsFormMode = True
            oItem.LinkTo = "DpsTxt"
            oItem.Enabled = False
            oEdittext = oItem.Specific
            oEdittext.DataBind.SetBound(True, "@ODPS", "DocEntry")
            oEdittext.Value = logno
            ''Order Edit Text Box
            oItem = oForm.Items.Add("OrdrVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 10
            oItem.LinkTo = "OrdrTxt"
            oItem.AffectsFormMode = True
            oEditordr = oItem.Specific
            '' Adding Choose From List
            oEditordr.DataBind.SetBound(True, "@ODPS", "U_ordrno")
            ' Adding 2 Choose From List Object, ONE FOR EDIT TEXT AND ONE FOR BUTTON.
            oEditordr.ChooseFromListUID = "CFL1"
            ''We set the alias only after the UID is set, the alias is the field in the database
            ''It compares the value in the edit text and narrows the CFL accrodingly
            oEditordr.ChooseFromListAlias = "DocEntry" '"CardCode"
            ''Order Date Edit Box
            oItem = oForm.Items.Add("OrdrdtVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 27
            oItem.AffectsFormMode = True
            oItem.LinkTo = "OrdrdtTxt"
            oItem.Enabled = False
            oEditorddt = oItem.Specific
            oEditorddt.DataBind.SetBound(True, "@ODPS", "U_ordrdt")
            ' oEditorddt.String = Format(DateTime.Today, "ddMMyy")
            ''Customer Edit Box
            oItem = oForm.Items.Add("CustVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 44
            oItem.AffectsFormMode = True
            oItem.LinkTo = "CustTxt"
            oItem.Enabled = False
            oEditcust = oItem.Specific
            oEditcust.DataBind.SetBound(True, "@ODPS", "U_customer")
            ''DPS Date Edit Box
            oItem = oForm.Items.Add("DateVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 376
            oItem.Width = 160
            oItem.Top = 27
            oItem.AffectsFormMode = True
            oItem.LinkTo = "DateTxt"
            oEditlogdt = oItem.Specific
            oEditlogdt.DataBind.SetBound(True, "@ODPS", "U_dpsdt")
            oEditlogdt.String = Format(DateTime.Today, "ddMMyy")
            ''Log No. Edit
            oItem = oForm.Items.Add("LogVal", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 61
            oItem.AffectsFormMode = True
            oItem.LinkTo = "LogTxt"
            oComboBox = oItem.Specific
            AddLogCodeCombo(oForm, val1)
            'AddLogCodeCombo(oComboBox)
            oComboBox.DataBind.SetBound(True, "@ODPS", "U_logno")
            'oComboBox.ValidValues.Add("", "")
            'oComboBox.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
            ''Total Trip for S/M Edit Box
            oItem = oForm.Items.Add("Trip1Val", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 430 '376
            oItem.Width = 105 '80
            oItem.Top = 300
            oItem.AffectsFormMode = True
            oItem.LinkTo = "Trip1Txt"
            oItem.Enabled = False
            oEditdep = oItem.Specific
            oEditdep.DataBind.SetBound(True, "@ODPS", "U_ttaltripsm")
            ''SuperVisor Edit Box
            oItem = oForm.Items.Add("SupVal", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 300
            oItem.AffectsFormMode = True
            oItem.LinkTo = "SupTxt"
            oEditsup = oItem.Specific
            oEditsup.DataBind.SetBound(True, "@ODPS", "U_suprvsr")
            ''Remarks Edit Box
            oItem = oForm.Items.Add("RmksVal", SAPbouiCOM.BoFormItemTypes.it_EXTEDIT)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 320
            oItem.AffectsFormMode = True
            oItem.LinkTo = "RmksTxt"
            oEditrmrk = oItem.Specific
            oEditrmrk.DataBind.SetBound(True, "@ODPS", "U_remark")
            ''Total Trip for Laterite Edit Box
            oItem = oForm.Items.Add("Trip2Val", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 430 '376
            oItem.Width = 105 '80
            oItem.Top = 320
            oItem.AffectsFormMode = True
            oItem.LinkTo = "Trip2Txt"
            oItem.Enabled = False
            oEditdep = oItem.Specific
            oEditdep.DataBind.SetBound(True, "@ODPS", "U_ttaltriplat")
            ''Total Trip for Bauxite Edit Box
            oItem = oForm.Items.Add("Trip3Val", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 430 '376
            oItem.Width = 105 '80
            oItem.Top = 340
            oItem.AffectsFormMode = True
            oItem.LinkTo = "Trip3Txt"
            oItem.Enabled = False
            oEditdep = oItem.Specific
            oEditdep.DataBind.SetBound(True, "@ODPS", "U_ttaltripbx")
            ''Total Trip for Item4 Edit Box
            oItem = oForm.Items.Add("Trip4Val", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 430 '376
            oItem.Width = 105 '80
            oItem.Top = 360
            oItem.AffectsFormMode = True
            oItem.LinkTo = "Trip4Txt"
            oItem.Enabled = False
            oEditdep = oItem.Specific
            oEditdep.DataBind.SetBound(True, "@ODPS", "U_ttaltripitm4")
            ''Total Trip for Item 5 Edit Box
            oItem = oForm.Items.Add("Trip5Val", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 430 '376
            oItem.Width = 105 '160
            oItem.Top = 380
            oItem.AffectsFormMode = True
            oItem.LinkTo = "Trip5Txt"
            oItem.Enabled = False
            oEditdep = oItem.Specific
            oEditdep.DataBind.SetBound(True, "@ODPS", "U_ttaltripitm5")
            '// Adding a OrderCFL button
            oItem = oForm.Items.Add("Button1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 269 '271
            oItem.Top = 8
            oButton = oItem.Specific
            oButton.Type = SAPbouiCOM.BoButtonTypes.bt_Image
            oItem.Width = 20
            oItem.Height = 20
            oButton.Image = IO.Directory.GetParent(Application.StartupPath).ToString & "\CFL.BMP"
            'SBO_Application.MessageBox(oButton.Image)
            'oButton.Image = "C:\Documents and Settings\subratac\My Documents\Visual Studio 2005\Projects\TestAddonApplication\TestAddonApplication\bin\CFL.BMP"
            '' Adding Choose From List Object FOR  BUTTON.
            oButton.ChooseFromListUID = "CFL2"
            'Adding a datasource to the form
            oDBDataSource = oForm.DataSources.DBDataSources.Add("@DPS1")
            '// Adding a Matrix item
            oItem = oForm.Items.Add("Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
            oItem.Left = 5
            oItem.Width = 550 '350
            oItem.Top = 95
            oItem.Height = 200 '150
            oMatrix = oItem.Specific
            oColumns = oMatrix.Columns
            '// Adding Culomn items to the matrix
            oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "#"
            oColumn.Width = 50
            oColumn.Editable = False
            'oColumn.DataBind.SetBound(True, "@DPS1", "U_holeno")
            '// Add a column for Vehicle no.
            'oColumn = oColumns.Add("Vhcleno", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            'oColumn.TitleObject.Caption = "Vehicle No."
            'oColumn.Width = 80
            'oColumn.Editable = True
            oColumn = oColumns.Add("Vhcleno", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)
            oColumn.TitleObject.Caption = "Vehicle No."
            oColumn.Width = 80
            oColumn.Editable = True
            oLink = oColumn.ExtendedObject
            oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Items
            oColumn.DataBind.SetBound(True, "@DPS1", "U_vehcleno")
            oColumn.ChooseFromListUID = "CFL5"
            oColumn.ChooseFromListAlias = "ItemCode"
            '// Add a column for vehicle name
            oColumn = oColumns.Add("Vhclenm", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Vehicle Name"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_vehclenm")
            '// Add a column for Trip S/M
            oColumn = oColumns.Add("Trpsm", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Trip(S/M)"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_tripsm")
            '// Add a column for Trip Laterite
            oColumn = oColumns.Add("Trplat", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Trip(Laterite)"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_triplat")
            '// Add a column for Trip Bauxite
            oColumn = oColumns.Add("Trpbax", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Trip(Bauxite)"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_tripbx")
            '// Add a column for Item 4
            oColumn = oColumns.Add("Trpitm4", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Trip(Item 4)"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_tripitm4")
            '// Add a column for Item 5
            oColumn = oColumns.Add("Trpitm5", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Trip(Item 5)"
            oColumn.Width = 80
            oColumn.Editable = True
            oColumn.DataBind.SetBound(True, "@DPS1", "U_tripitm5")
            ''// Link the column to the Stock Transfer master data system form
            'oLink = oColumn.ExtendedObject
            'oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_StockTransfers
            '// Adding a OK button
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = 400 '372
            oItem.Height = 20
            oButton = oItem.Specific
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = 400 '372
            oItem.Height = 20
            oButton = oItem.Specific
            AddLogCodeCombo(oForm, val)
            oForm.DataBrowser.BrowseBy = "DpsVal"
        End Sub
        Public Sub New()
            MyBase.New()
            Try
                SetApplication()
                ' Set The Connection Context
                If Not SetConnectionContext() = 0 Then
                    SBO_Application.MessageBox("Failed setting a connection to DI API")
                    End ' Terminating the Add-On Application
                End If
                If Not ConnectToCompany() = 0 Then
                    SBO_Application.MessageBox("Failed connecting to the company's Data Base")
                    End ' Terminating the Add-On Application
                End If
                'SBO_Application.MessageBox("DI Connected To: " & oCompany.CompanyName)
            Catch
                System.Windows.Forms.MessageBox.Show("SBO application not found")
            End Try
            AddMenuItems()
        End Sub
        Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes) Handles SBO_Application.AppEvent
            Select Case EventType
                Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown
                    SBO_Application.MessageBox("A Shut Down Event has been caught" & _
                        Environment.NewLine() & "Terminating 'Complex Form' Add On...")
                    '// Take care of terminating your AddOn application
                    System.Windows.Forms.Application.Exit()
            End Select
        End Sub
        Private Function SetConnectionContext() As Integer
            Dim sCookie As String
            Dim sConnectionContext As String
            ' Dim lRetCode As Integer
            '// First initialize the Company object
            oCompany = New SAPbobsCOM.Company
            '// Acquire the connection context cookie from the DI API.
            sCookie = oCompany.GetContextCookie
            '// Retrieve the connection context string from the UI API using the
            '// acquired cookie.
            sConnectionContext = SBO_Application.Company.GetConnectionContext(sCookie)
            '// before setting the SBO Login Context make sure the company is not
            '// connected
            If oCompany.Connected = True Then
                oCompany.Disconnect()
            End If
            '// Set the connection context information to the DI API.
            SetConnectionContext = oCompany.SetSboLoginContext(sConnectionContext)
        End Function
        Private Function ConnectToCompany() As Integer
            '// Make sure you're not already connected.
            If oCompany.Connected = True Then
                oCompany.Disconnect()
            End If
            '// Establish the connection to the company database.
            ConnectToCompany = oCompany.Connect
        End Function
        Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim oForm As SAPbouiCOM.Form
            oForm = SBO_Application.Forms.Item(FormUID)
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim count As Integer
            Dim oDataSrc As SAPbouiCOM.DataSource
            Select Case pVal.EventType
                Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                    '// Check if the event was raised by one of the Folder items
                    '// and change the form's pane level
                Case SAPbouiCOM.BoEventTypes.et_CLICK
                    ' If pVal.ItemUID = "1" And pVal.BeforeAction = True Then
                    'If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then
                    'If Validation() = False Then
                    'If oForm.Items.Item("OrdrVal").Specific().Value = "" Then
                    '    BubbleEvent = False
                    '    ' SBO_Application.MessageBox(" Please Enter  The Order No ")
                    '    SBO_Application.StatusBar.SetText("Enter The  Order  No - 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    '    oForm.Items.Item("OrdrVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                    '    Exit Sub
                    'End If
                    'If oForm.Items.Item("SupVal").Specific().Value = "" Then
                    '    BubbleEvent = False
                    '    ' SBO_Application.MessageBox(" Please Enter  The Order No ")
                    '    SBO_Application.StatusBar.SetText("Enter The  Supervisor - 3029 Item Is Not Selectable  ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    '    oForm.Items.Item("SupVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                    '    Exit Sub
                    'End If
                    If pVal.FormMode = 2 And pVal.ItemUID = "1" And pVal.BeforeAction = False Then
                        'In UPDATE Mode
                        ' strDocNum = oForm.Items.Item("txtCode").Specific.String
                        ' If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE And oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then
                        Dim strdocnum As String
                        strdocnum = oForm.Items.Item("DpsVal").Specific.String
                        oMatrix = oForm.Items.Item("Matrix1").Specific
                        oDataSrc = oForm.DataSources.DBDataSources.Add("@DPS1")
                        oForm.Freeze(True)
                        UpdateMatrixRowsDel(oForm)
                        oMatrix.FlushToDataSource()
                        For count = 1 To oMatrix.RowCount
                            oDataSrc.SetValue("LineId", count - 1, oDataSrc.GetValue("DocEntry", count - 1))
                        Next
                        oMatrix.LoadFromDataSource()
                        oForm.Freeze(False)
                    End If
                    '  End If
                    'End If
                    'End If
            End Select
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                If oCFLEvento.BeforeAction = False Then
                    Dim oDataTable As SAPbouiCOM.DataTable
                    oDataTable = oCFLEvento.SelectedObjects
                    ''//Function to show values in EditBoxes and Matrix after pressing TAB button.
                    ShowAllData(pVal, oDataTable, oForm)
                End If
            End If
            Dim Matrix As SAPbouiCOM.Matrix
            Matrix = oForm.Items.Item("Matrix1").Specific
            'If ((pVal.ItemUID = "Matrix1") And (pVal.Row = Matrix.RowCount) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then
            '    ' Matrix.AddRow(1, -1)
            '    Matrix.AddRow(1, -1)
            '    Matrix.Columns.Item("#").Cells.Item(Matrix.RowCount).Specific.Value = Matrix.RowCount
            'End If
            If (FormUID = "SM_DPSFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) Then
                Windows.Forms.Application.Exit()
            End If
            'ShowTripTotal(pVal, oForm)
            Dim i As Integer
            Dim tripsm As Integer = 0
            Dim triplat As Integer = 0
            Dim tripbax As Integer = 0
            Dim tripitm4 As Integer = 0
            Dim tripitm5 As Integer = 0
            If ((pVal.FormUID = "SM_DPSFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Or (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then
                For i = 1 To Matrix.RowCount
                       tripsm += Matrix.Columns.Item(3).Cells.Item(i).Specific.Value
                    oForm.Items.Item("Trip1Val").Specific().value = tripsm
                    triplat += Matrix.Columns.Item(4).Cells.Item(i).Specific.Value
                    oForm.Items.Item("Trip2Val").Specific().value = triplat
                    tripbax += Matrix.Columns.Item(5).Cells.Item(i).Specific.Value
                    oForm.Items.Item("Trip3Val").Specific().value = tripbax
                    tripitm4 += Matrix.Columns.Item(6).Cells.Item(i).Specific.Value
                    oForm.Items.Item("Trip4Val").Specific().value = tripitm4
                    tripitm5 += Matrix.Columns.Item(7).Cells.Item(i).Specific.Value
                    oForm.Items.Item("Trip5Val").Specific().value = tripitm5
                    Matrix.LoadFromDataSource()
                Next
            End If
        End Sub
        Private Sub SalesOrdrCFL(ByVal oForm As SAPbouiCOM.Form)
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                'Dim oCons As SAPbouiCOM.Conditions
                'Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "17"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                oCFLCreationParams.UniqueID = "CFL2"
                oCFL = oCFLs.Add(oCFLCreationParams)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
        Private Sub OBRCFL(ByVal oForm As SAPbouiCOM.Form)
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                ' Dim oCons As SAPbouiCOM.Conditions
                ' Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "SM_OOBR"
                oCFLCreationParams.UniqueID = "CFL3"
                oCFL = oCFLs.Add(oCFLCreationParams)
                '' Adding Conditions to CFL1
                'oCons = oCFL.GetConditions()
                'oCon = oCons.Add()
                'oCon.Alias = "U_ordrdt" '"Order Date" '"U_ordrdt" '"Balance"
                'oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                'oCon.CondVal = oForm.Items.Item("OrdrdtVal").Specific().string  '"120000"
                'oCFL.SetConditions(oCons)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
        Private Sub itemlist(ByVal oForm As SAPbouiCOM.Form)
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                '  Dim oCons As SAPbouiCOM.Conditions
                '  Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "4"
                oCFLCreationParams.UniqueID = "CFL5"
                oCFL = oCFLs.Add(oCFLCreationParams)
                oCFLCreationParams.UniqueID = "CFL5"
                oCFL = oCFLs.Add(oCFLCreationParams)
                'oCFL = oCFLs.Add(oCFLCreationParams)
                'oCons = oCFL.GetConditions()
                'oCon = oCons.Add()
                'oCon.Alias = "ItemCode"
                'oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START
                'oCon.CondVal = "V"
                'oCFL.SetConditions(oCons)
            Catch
                Exit Sub
                MsgBox(Err.Description)
            End Try
        End Sub
        Private Sub ShowAllData(ByRef pVal As SAPbouiCOM.ItemEvent, ByVal oDatatable As SAPbouiCOM.DataTable, ByVal oForm As SAPbouiCOM.Form)
            Dim val, val2, val4 As String
            Dim val1 As String
            Dim i As Integer
            Dim oCombo As SAPbouiCOM.ComboBox
            oCombo = oForm.Items.Item("LogVal").Specific
            Dim Matrix As SAPbouiCO

  • User Data source with matrix

    Hi all ,,
    i have a question if you can help me :
    i put choose from list in matrix but when i choose item didn't fill in the column and my code is :
    ** on create form
       oForm.DataSources.UserDataSources.Add("IDS", BoDataType.dt_SHORT_TEXT);
                    SAPbouiCOM.Matrix Mat = (SAPbouiCOM.Matrix)oForm.Items.Item("12").Specific;
                  //  SAPbouiCOM.EditTextColumn EC = Mat.Columns.It
                    Mat.Columns.Item("V_ITM").ChooseFromListUID = "ITM";
                    Mat.Columns.Item("V_ITM").ChooseFromListAlias = "ItemCode";
                    Mat.Columns.Item("V_ITM").DataBind.SetBound(true, "", "IDS");
    ***on Item Event
        if ((pVal.ColUID== "V_4"))
                            //oForm.DataSources.UserDataSources.Item("IDS").ValueEx = val;
                             SAPbouiCOM.Matrix Mat = (SAPbouiCOM.Matrix)oForm.Items.Item("12").Specific;
                      //  SAPbouiCOM.EditTextColumn EC = Mat.Columns.It
                             SAPbouiCOM.EditText c = null ;
                            try
                                 oForm.DataSources.UserDataSources.Item("IDS").ValueEx = val;
                                 Mat.LoadFromDataSource();

    Hi folks, i know this thread is a little old but i have the same insue and i want to share the solution, it could help others.
    Like Mayank said, get line and set line works the last row of the matrix, but is not true at all, GetLineData and SetLineData works for the row of the matrix that is set on the offset of DBDatasource lines, so to works fine you need to set the offset first.
    oForm.DataSources.DBDataSources.Item("@MY_DS_LINES").Offset = x-1;
    Mat.GetLineData(x);
    oForm.DataSources.UserDataSources.Item("IDS").ValueEx = val;
    // Update any other UserDataSources for the same row here...
    Mat.SetLineData(x);
    where x is the row number of the matrix you want to update.

  • [svn:fx-trunk] 10002: Gradient matrix transform fix

    Revision: 10002
    Author:   [email protected]
    Date:     2009-09-03 13:17:09 -0700 (Thu, 03 Sep 2009)
    Log Message:
    Gradient matrix transform fix
    http://bugs.adobe.com/jira/browse/SDK-22928 - Gradient matrix transform applying incorrect transforms
    Previously, the logic transformed the gradient to fill the shape bounds and then combined the matrix transform. Now using the same values for the discreet transform properties versus the matrix properties should result in the same appearance.
    These changes are applied to LinearGradient, RadialGradient, LinearGradientStroke and RadialGradientStroke.
    QE notes: Matrix transform behavior has changed
    Doc notes: Need info on matrix behavior
    Bugs: SDK-22928
    Reviewer: Glenn
    Tests run: spark/primitives
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22928
        http://bugs.adobe.com/jira/browse/SDK-22928
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as

  • Matrix Add Row and Duplicate Row

    Hi All,
    Can anybody suggest me how to work on Add row and duplicate row in any document table.
    Lets take one example
    Sales order document
    In this doc we have table format where we specify item no, item description etc. In this table when we right click on particluar row we have option for add, delete, duplicate rows..etc.
    wht i would like to know is that when we click add row .....one row is added and number is incremented under # column.  Hw to perform and display this auto increment/ decrement of number for these rows under this # column
    thanks
    harish

    Hi,
    I tried following both code, but in that i am geting value. Means i am getting .Value  Why i not getting value.
      matrix.Columns.Item("V_-1").Cells.Item(pVal.Row).Specific.value = matrix.RowCount
    and i also tried for "AddRow",
    If pVal.BeforeAction = False Then
                    Select Case pVal.ItemUID
                        Case "AddRow"
                            matrix = form.Items.Item("mtr").Specific
                            If matrix.RowCount > 0 Then
                                If Trim(matrix.Columns.Item("V_-1").Cells.Item(matrix.RowCount).Specific.value) = "" Then
                                End If
                            End If
                    End Select
                End If
    In both example i not getting .Value.
    Plz tell y ?
    Thanks

  • How to calculate Sales percentage difference between selected year and its previous year in a Matrix

    Hi,
    I'm trying to generate a report using matrix like this
                                                          Month
    Product     PreviousYearSalesAmount    SelectedYearSalesAmount      %SalesDifference
    I can populate year sales amount, but i cant calculate the percentage.
    Can Anyone help me please.
    Note: Month and Year are passed as parameters.
    Thank you.

    Hi Abhiram,
    As per my understanding you can show your fields in matrix.
    Only problem is to create the additional column which will have the  %SalesDifference value right?
    If yes,
    Just create one column as shown in below screen,
    It will create one column, Name the header of this newly created column as %SalesDifference
    In below this header , where you want to show the value for %SalesDifference as
    =sum(iif(Fields!year.Value=Parameters!year.Value,(Fields!SalesAmount.Value),-Fields!SalesAmount.Value))/Fields!SalesAmount.Value
    Set the property of the column in number as Percentage.
    run the report, you will see as below screen.
    For your reference I am attaching my RDL code, you can save as .rdl file and run the report (sample Data inside the report only)
    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
    <Body>
    <ReportItems>
    <Textbox Name="textbox1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Matrix</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>14pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>SteelBlue</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox1</rd:DefaultName>
    <Height>0.37in</Height>
    <Width>5in</Width>
    <Style>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    <Tablix Name="Tablix1">
    <TablixCorner>
    <TablixCornerRows>
    <TablixCornerRow>
    <TablixCornerCell>
    <CellContents>
    <Textbox Name="Textbox16">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Product</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox16</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCornerCell>
    </TablixCornerRow>
    <TablixCornerRow>
    <TablixCornerCell>
    <CellContents>
    <Textbox Name="Textbox17">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value />
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox17</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCornerCell>
    </TablixCornerRow>
    </TablixCornerRows>
    </TablixCorner>
    <TablixBody>
    <TablixColumns>
    <TablixColumn>
    <Width>1.79722in</Width>
    </TablixColumn>
    <TablixColumn>
    <Width>1.76722in</Width>
    </TablixColumn>
    </TablixColumns>
    <TablixRows>
    <TablixRow>
    <Height>0.25in</Height>
    <TablixCells>
    <TablixCell>
    <CellContents>
    <Textbox Name="SalesAmount">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Sum(Fields!SalesAmount.Value)</Value>
    <Style />
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>SalesAmount</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="Textbox76">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=sum(iif(Fields!year.Value=Parameters!year.Value,(Fields!SalesAmount.Value),-Fields!SalesAmount.Value))/Fields!SalesAmount.Value</Value>
    <Style>
    <Format>0.00%</Format>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox76</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    </TablixCells>
    </TablixRow>
    </TablixRows>
    </TablixBody>
    <TablixColumnHierarchy>
    <TablixMembers>
    <TablixMember>
    <Group Name="month">
    <GroupExpressions>
    <GroupExpression>=Fields!month.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!month.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="month1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=MonthName(Fields!month.Value)</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>month1</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember>
    <Group Name="year">
    <GroupExpressions>
    <GroupExpression>=Fields!year.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!year.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="year">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!year.Value</Value>
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>year</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember />
    </TablixMembers>
    </TablixMember>
    </TablixMembers>
    </TablixMember>
    <TablixMember>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="Textbox61">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>%SalesDifference</Value>
    <Style>
    <FontStyle>Normal</FontStyle>
    <FontWeight>Bold</FontWeight>
    <TextDecoration>None</TextDecoration>
    <Color>#000000</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox61</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>LightBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    <TablixMembers>
    <TablixMember>
    <TablixHeader>
    <Size>0.25in</Size>
    <CellContents>
    <Textbox Name="Textbox62">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value />
    <Style>
    <FontWeight>Bold</FontWeight>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox62</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    </TablixMember>
    </TablixMembers>
    </TablixMember>
    </TablixMembers>
    </TablixColumnHierarchy>
    <TablixRowHierarchy>
    <TablixMembers>
    <TablixMember>
    <Group Name="Product">
    <GroupExpressions>
    <GroupExpression>=Fields!Product.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!Product.Value</Value>
    </SortExpression>
    </SortExpressions>
    <TablixHeader>
    <Size>1.38889in</Size>
    <CellContents>
    <Textbox Name="Product1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!Product.Value</Value>
    <Style />
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Product1</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixHeader>
    </TablixMember>
    </TablixMembers>
    </TablixRowHierarchy>
    <DataSetName>DataSet1</DataSetName>
    <Top>0.38in</Top>
    <Left>0.04667in</Left>
    <Height>0.75in</Height>
    <Width>4.95333in</Width>
    <ZIndex>1</ZIndex>
    <Style>
    <Border>
    <Style>None</Style>
    </Border>
    </Style>
    </Tablix>
    </ReportItems>
    <Height>1.20167in</Height>
    <Style />
    </Body>
    <Width>5.1in</Width>
    <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
    </Page>
    <AutoRefresh>0</AutoRefresh>
    <DataSources>
    <DataSource Name="DataSource1">
    <DataSourceReference>DataSource1</DataSourceReference>
    <rd:SecurityType>None</rd:SecurityType>
    <rd:DataSourceID>501ee6de-61fb-416f-9a92-011661d01cba</rd:DataSourceID>
    </DataSource>
    </DataSources>
    <DataSets>
    <DataSet Name="DataSet1">
    <Query>
    <DataSourceName>DataSource1</DataSourceName>
    <QueryParameters>
    <QueryParameter Name="@year">
    <Value>=Parameters!year.Value</Value>
    </QueryParameter>
    <QueryParameter Name="@Month">
    <Value>=Parameters!Month.Value</Value>
    </QueryParameter>
    </QueryParameters>
    <CommandText>select * from
    select 'apple' Product ,1 month ,2014 year,2000 SalesAmount
    union
    select 'apple' Product ,1 month,2015 year,3000 SalesAmount
    union
    select 'dell' Product ,1 month,2014 year,3000 SalesAmount
    union
    select 'dell' Product ,1 month,2015 year,2500 SalesAmount
    union
    select 'apple' Product ,2 month,2014 year,1500 SalesAmount
    union
    select 'apple' Product ,2 month,2015 year,3000 SalesAmount
    union
    select 'dell' Product ,2 month,2014 year,3000 SalesAmount
    union
    select 'dell' Product ,2 month,2015 year,5500 SalesAmount
    )t
    where year between @year-1 and @year
    and Month=@Month</CommandText>
    <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
    </Query>
    <Fields>
    <Field Name="Product">
    <DataField>Product</DataField>
    <rd:TypeName>System.String</rd:TypeName>
    </Field>
    <Field Name="month">
    <DataField>month</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="year">
    <DataField>year</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="SalesAmount">
    <DataField>SalesAmount</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    </Fields>
    </DataSet>
    </DataSets>
    <ReportParameters>
    <ReportParameter Name="year">
    <DataType>String</DataType>
    <DefaultValue>
    <Values>
    <Value>2015</Value>
    </Values>
    </DefaultValue>
    <Prompt>year</Prompt>
    </ReportParameter>
    <ReportParameter Name="Month">
    <DataType>String</DataType>
    <DefaultValue>
    <Values>
    <Value>1</Value>
    </Values>
    </DefaultValue>
    <Prompt>Month</Prompt>
    </ReportParameter>
    </ReportParameters>
    <Language>en-US</Language>
    <ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
    <rd:ReportUnitType>Inch</rd:ReportUnitType>
    <rd:ReportID>ee1a8383-6595-42b1-94f2-c68d681c85d3</rd:ReportID>
    </Report>
    Thanks
    Prasad
    Mark this as Answer if it helps you to proceed on further.

  • Form/Event Error

    I have the folllowing code in the item event:
    If pVal.FormTypeEx = "mcgscomm" Then
        If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = False Then
                    If pVal.ItemUID = "btnOk" Then
                        CleanForm(oForm)
                    End If
        End If
    End If
    The Cleanform routines is as follows:
    Private Sub CleanForm(ByRef oForm As SAPbouiCOM.Form)
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim oStaticText As SAPbouiCOM.StaticText
            Dim oEditText As SAPbouiCOM.EditText
            oMatrix = oForm.Items.Item("M_Matrix").Specific
            oMatrix.Clear()
            oStaticText = oForm.Items.Item("mcg_CName").Specific
            oStaticText.Caption = ""
            oEditText = oForm.Items.Item("mcg_Date").Specific
            oEditText.Value = ""
            oEditText = oForm.Items.Item("mcg_Inv").Specific
            oEditText.Value = ""
            oForm.DataSources.UserDataSources.Item("StatusDS").ValueEx = "Selected"
            oForm.DataSources.UserDataSources.Item("SlspDS").ValueEx = ""
            oForm.DataSources.UserDataSources.Item("CustDS").ValueEx = ""
            oForm.DataSources.UserDataSources.Item("SalesDS").ValueEx = 0
            oForm.DataSources.UserDataSources.Item("CostDS").ValueEx = 0
            oForm.DataSources.UserDataSources.Item("CommDS").ValueEx = 0
            oForm.DataSources.UserDataSources.Item("CPerDS").ValueEx = 0
            oEditText.Active = True
        End Sub
    The issue is that the cleanform executes without problem but when the item event completes the application crashes (I'm not getting any messages from the debugger so it's making hard to determine the issue).  Any suggestions?
    Regards,
    WB

    Thanks for the suggestion, I figure it out.  The .net profiler gave me an idea where it was crashing, now the weird thing and in this case I think is VS.NET that has a bug with the DI/UI API.  When I changed the editbox, this was triggering a et_VALIDATE event that I'm trapping in the item event.  Now the debugger was running the event code but it was not showing it, if I placed a breakpoint it will never stop so that was not letting me know that the error was occurring there. 
    As soon as I figure it out a small if statement fixed the problem.
    Thanks to all,
    WB

  • Mathscript - modeling Z(x,y)

    Although a LabVIEW veteran, I am just starting working with mathscript window (and node).  I did some playing today but need to know the proper way to model uncertainty in a process that I am doing.  Ultimately, the uncertainty (z4) is a function of two variables (twotau and deltat) in the following script - therefore I expect to generate a 3d surface graph with z4, twotau, and deltat on the Z, X, and Y axes, respectively.  Here is the script.  How do I specify the range for twotau and deltat so that this script will run.  Thanks for your help......Don
    SR=6.4;
    v=0.029;
    a=(1/(2*SR));
    c=0.02997055434;
    z1=-c/(twotau);
    z2=c*deltat/(twotau)^2;
    z3=sqrt((z1^2)*(a^2)+(z2^2)*(a^2));
    z4=(z3/v)*100;

    Hello Don,
    You state in your first reply that you did not concentrate on the matrix versus non-matrix calculations.  Unfortunately, this was the cause of the first error message you received.  Line 8 reads
    z1 = -c/twotau;
    This tries to divide a scalar by a matrix and it is not a defined operation.  By adding a period to the operation, you tell LabVIEW MathScript to perform a scalar division (i.e. elementwise).  You did add the periods in your second reply and got a different error later in the script.  If you run your script in the MathScript Window and look at the variable values after execution, you can see that we are trying to generate a surface plot with xx and yy (both 100x100 matrices) and z4 (a 1x100 matrix).  These are the incompatible sizes the error is informing you of.  You got off to the right start using the meshgrid function to generate the matrices corresponding to twotau and deltat.  However, you then need to use these matrices in any computation of 2D matrices.  Your script continued to use deltat and twotau in the computation of the z matrices.  Instead of using xx for twotau and yy for deltat, I'll use tt and dt, respectively.  If you change your code to the following, it should work fine.
    [tt dt] = meshgrid(twotau, deltat);
    z1=-c./tt;
    z2=c.*dt./tt.^2;
    Of course, you'll also need to change your surf command to be
    surf(tt, dt, z4)
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Use of GetLineData Method

    Hi,
    I am trying to update a single row in a matrix having no. of rows. Will it be compulsory for me now to use 'oMatrix.FlushtoDatasource()'? Can't i use 'oMatrix.GetLineData()'as i need to pick the latest entries of a single row only. oMatrix is binded to dbdatasource only, no userdatasource used.
    HK

    Yes you can use GetLineData(). Should be something like this:...
    matrix.GetLineData(pVal.Row);
    //Set datasource values (For userdatasource it is its value-property and for dbdatasources its dbds.SetValue("field",dbds.Offset,"newvalue"))
    matrix.SetLineData(pVal.Row);
    /Rasmus

  • Data Retrieving

    hi friends
    i Created a form with three edit boxes(Name,Age and ***) . i want to retrieve data from the data base. If i type the Name i should get the remaining fields automatically..Can you provide me with some sample codings?
    Thanks and Regards
    Manoj Nagaraj

    Hi.
    In addition to  Dilip Kumbhar message: so you can retrieve data from your table and write it into fields on form.
    BR
    Sierdnas
    try
      oForm.Freeze(True)
      ' Code value for additional where part
      Dim sCode As String
      ' in the case if you have userdatasources
      sCode = oForm.DataSources.UserDataSources.Item("uCode").Value
      ' or if you have dbdatasources
      ' sCode = oForm.DataSources.DBDataSources.Item("@YOUR_USER_TABLE").GetValue("Code", 0)
      Dim sVal1 As String = ""
      Dim sVal2 As String = ""
      Dim oRS As SAPbobsCOM.Recordset
      oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
      Dim sSql As String = "SELECT Field1, Field2 FROM [@" & sMyTable & _
                           "] WHERE Code = '" & sCode & "'"
      oRS.DoQuery(sSql)
      oRS.MoveFirst()
      While oRS.EoF = False
        sVal1 = oRS.Fields.Item("Field1").Value
        sVal2 = oRS.Fields.Item("Field2").Value
        Exit While
      End While
      ' in the case if you have userdatasources
      oForm.DataSources.UserDataSources.Item("uField1").ValueEx = sField1
      oForm.DataSources.UserDataSources.Item("uField2").ValueEx = sField2
      ' or if you have dbdatasources
      ' oForm.DataSources.DBDataSources.Item("@YOUR_USER_TABLE").SetValue("Field1", 0, sVal1)
      ' oForm.DataSources.DBDataSources.Item("@YOUR_USER_TABLE").SetValue("Field2", 0, sVal2)
    catch ex As Exception
      ' log exception
    finally
      If Not oRS Is Nothing Then
        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
        oRS = Nothing
      End If
      System.GC.Collect() 'Release the handle to the table
      oForm.Freeze(False)
    end try
    Edited by: Sierdna S on Jul 16, 2008 3:23 PM

Maybe you are looking for

  • Sharpening in ACR has stopped working

    I always open files as smart objects. When I sharpen a photo in ACR and open in Photoshop the sharpening doesn't appear; if I reopen in ACR, the changes I have made to radius are there, but the stregnth is zero. I have tried this on numerous photos,

  • The problem of connection in mail scenario

    Hi,gurus:    My scenario is file to mail.Now the scenario runs well in sxmb_moni.But in communication channel monitoring ,the error message is below: 2008-07-26 19:30:13 Success The message status set to DLNG. 2008-07-26 19:30:13 Success Delivering t

  • Flash Player written in the Flash 8

    Hi All, How can I write flash player with flash 8? I need flash that can play other *.swf files. I don't know what components and functions I should use. Please help me with this

  • I upgraded from a iPod touch to a iPad. Now my playlists from the iPod won't show up in iTunes.

    My iPod still has my playlists. But when I sync with iTunes, they don't transfer over. I'm trying to export the playlists so I can import them to the new iPad.

  • WPA IO stack analysis

    REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive -d 0x1 -t REG_DWORD -f xperf -on PROC_THREAD+LOADER+CSWITCH+FILENAME+FILE_IO+FILE_IO_INIT+DRIVERS+FLT_IO_INIT+FLT_IO+FLT_FASTIO+FLT_IO_FAILURE