Change forecolor of one row in a matrix

Hi, can I change the color of the text in a row of a matrix?
I've tried with
matrix.column.item("idcol").forecolor = 555555
In this mode I change the color of all the row in column idcol. I would like to change the color to one of the row of the column idcol.
Can I do?
Thank you
Regards
Marco

Hi Marco Trestini
Unfortunatly you can NOT change the row colour or the text row colour. We can only do colour modification by columns only. Hopefully in future versions we can.
Hope this helps

Similar Messages

  • Change value of one row

    Microsoft SQL Server 2014 - 12.0.2254.0 (X64)
     Jul 25 2014 18:52:51
     Copyright (c) Microsoft Corporation
     Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )
    Hi,
    I have a little bit problem. I would like to change the value of one row calculated in this way:
    SELECT distinct ID,s7.Name_Account ,
    sum (s7.Y2006* 1.0 / t7.Y2006) as V2006,sum (s7.Y2007* 1.0 / t7.Y2007) as V2007,sum (s7.Y2008* 1.0/ t7.Y2008) as V2008,sum (s7.Y2009* 1.0/ t7.Y2009) as V2009,
    sum (s7.Y2010* 1.0/ t7.Y2010) as V2010,sum (s7.Y2011* 1.0 / t7.Y2011) as V2011,sum (s7.Y2012* 1.0/ t7.Y2012) as V2012,sum (s7.Y2013* 1.0/ t7.Y2013) as V2013
    FROM sumas7 as s7 , total1 as t7
    Where ID IS NULL and Name_Account IS NULL
    GROUP BY Name_Account, ID
    WITH ROLLUP
    As we know this Transact- SQL produce a NULL value as total. My intention is to change this value (NULL) by text value, for example, "NON Current Assets" . Is it possible?  and if it is possible How could I do it?
    Thanks in advance
    Un saludo

    which column has NULLs
    as per posted code I guess it should be Name_Account
    in which case what you need is this
    Also distinct here is meaningless as you're already applying GROUP BY
    SELECT ID,
    COALESCE(s7.Name_Account,'Non Current Assets') AS Name_Account,
    sum (s7.Y2006* 1.0 / t7.Y2006) as V2006,sum (s7.Y2007* 1.0 / t7.Y2007) as V2007,sum (s7.Y2008* 1.0/ t7.Y2008) as V2008,sum (s7.Y2009* 1.0/ t7.Y2009) as V2009,
    sum (s7.Y2010* 1.0/ t7.Y2010) as V2010,sum (s7.Y2011* 1.0 / t7.Y2011) as V2011,sum (s7.Y2012* 1.0/ t7.Y2012) as V2012,sum (s7.Y2013* 1.0/ t7.Y2013) as V2013
    FROM sumas7 as s7 , total1 as t7
    Where ID IS NULL and Name_Account IS NULL
    GROUP BY Name_Account, ID
    WITH ROLLUP
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Set Forecolor for the row in a matrix

    Hi,
    I'd like to do a matrix with many Log Messages (like System Message Log in Sap), and each row can have a different color (Blu = information, Red = Error, etc). What is the properties that i must set to change the color for every row??
    Thanks
    Marco

    Hi,
    U can only set the forecolor to the Column. Its not possible to set the color to the ROWs.
    Vasu Natari.

  • How to change the forecolor of a single row of a matrix

    In a matrix which is displaying list of items like the Sales Order Form, I am trying to change the forecolor to red for only those items where the item's required quantity is lesser than the item's avialable quantity.
    The Code Snippet is as follows:
    ReqQty = oMatrix.Columns.Item("ReqQty").Cells.Item(pval.row).Specific.value
    AvaQty = oMatrix.Columns.Item("AvaQty").Cells.Item(pval.row).Specific.value
    If ReqQty > AvaQty Then
    Dim txtField As SAPbouiCOM.EditText
    oMatrix = oform.Items.Item("cMatrix").Specific
    txtField = oMatrix.Columns.Item("ItemNo").Cells.Item (pval.row).Specific
    txtField.ForeColor = 200
    txtField = oMatrix.Columns.Item("ItemDesc").Cells.Item(pval.row).Specific
    txtField.ForeColor = 200
    oMatrix.Columns.Item("ReqQty").Cells.Item(pval.row).Specific
    txtField.ForeColor = 200
    oMatrix.Columns.Item("AvaQty").Cells.Item(pval.row).Specific
    txtField.ForeColor = 200
    End If
    But the problem is , if this condition applies to any one of the items in the matrix, then all the rows in the matrix change the forecolor to red.
    Has anyone faced this problem and has a solution to it?

    I haven't tested the problems you have for a matrix.
    But I have seen the properties are not exposed for the Cell object...
    Regarding the ForeColor and BackColor on the EditText they are deprecated starting from 2004 BUT you have the same properties now exposed at the <b>Item</b> level.
    For the Column object the ForeColor and BackColor are not market as deprecated.
    Regards
    Trinidad.

  • Changing background color in JTable, only changes one row at a time...

    I'm trying to change the color of rows when the 5th column meets certain criteria. I think I'm very close, but I've hit a wall.
    What's happening is the row will change color as intended when the text in the 5th column is "KEY WORD", but when I type "KEY WORD" in a different column it will set the first row back to the regular colors. I can easily see why it's doing this, everytime something is changed it rerenders every cell, and the listener only checks the cell that was just changed if it met the "KEY WORD" condition, so it sets every cell (including the previous row that still meets the condition) to the normal colors. I can't come up with a good approach to changing the color for ALL rows that meet the condition. Any help would be appreciated.
    In this part of the CellRenderer:
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            //row that meets special conditions
            if(row == specRow && col == specCol)
                color = color.white; I was thinking an approach would be to set them to their current color except for the one that meets special conditions, but the two problems with that are I can't figure out how to getColor() from the table, and I'm not sure how I would initially set the colors.
    Here's the rest of the relevant code:
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(colIndex == 4)
                String value = (String)centerTable.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("KEY WORD"))
                    for(int j = 0; j < centerTable.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)centerTable.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    import javax.swing.table.*;
    import javax.swing.*;
    import java.awt.Component;
    import java.awt.Color;
    public class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.green;
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            if(row == specRow && col == specCol)
                color = color.white;
            //setForeground(color);
            setBackground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }If I'm still stuck and more of my code is needed, I'll put together a smaller program that will isolate the problem tomorrow.

    That worked perfectly for what I was trying to do, but I've run into another problem. I'd like to change the row height when the conditions are met. What I discovered is that this creates an infinite loop since the resizing triggers the renderer, which resizes the row again, etc,. What would be the proper way to do this?
    Here's the modified code from the program given in the link. All I did was declare the table for the class, and modify the if so I could add the "table.setRowHeight(row, 30);" line.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class TableRowRenderingTip extends JPanel
        JTable table;
        public TableRowRenderingTip()
            Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"};
            Object[][] data =
                {"Buy", "IBM", new Integer(1000), new Double(80.5), Boolean.TRUE},
                {"Sell", "Dell", new Integer(2000), new Double(6.25), Boolean.FALSE},
                {"Short Sell", "Apple", new Integer(3000), new Double(7.35), Boolean.TRUE},
                {"Buy", "MicroSoft", new Integer(4000), new Double(27.50), Boolean.FALSE},
                {"Short Sell", "Cisco", new Integer(5000), new Double(20), Boolean.TRUE}
            DefaultTableModel model = new DefaultTableModel(data, columnNames)
                public Class getColumnClass(int column)
                    return getValueAt(0, column).getClass();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Alternating", createAlternating(model));
            tabbedPane.addTab("Border", createBorder(model));
            tabbedPane.addTab("Data", createData(model));
            add( tabbedPane );
        private JComponent createAlternating(DefaultTableModel model)
            JTable table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Alternate row color
                    if (!isRowSelected(row))
                        c.setBackground(row % 2 == 0 ? getBackground() : Color.LIGHT_GRAY);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        private JComponent createBorder(DefaultTableModel model)
            JTable table = new JTable( model )
                private Border outside = new MatteBorder(1, 0, 1, 0, Color.RED);
                private Border inside = new EmptyBorder(0, 1, 0, 1);
                private Border highlight = new CompoundBorder(outside, inside);
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    JComponent jc = (JComponent)c;
                    // Add a border to the selected row
                    if (isRowSelected(row))
                        jc.setBorder( highlight );
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public JComponent createData(DefaultTableModel model)
            table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Color row based on a cell value
                    if (!isRowSelected(row))
                        c.setBackground(getBackground());
                        String type = (String)getModel().getValueAt(row, 0);
                        if ("Buy".equals(type)) {
                            table.setRowHeight(row, 30);
                            c.setBackground(Color.GREEN);
                        if ("Sell".equals(type)) c.setBackground(Color.YELLOW);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
        public static void createAndShowGUI()
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("Table Row Rendering");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add( new TableRowRenderingTip() );
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }Edited by: scavok on Apr 26, 2010 6:43 PM

  • Change this code to retrieve more than one row in the drop out menu

    How I can change this code, it only works when the cursor retrieves one row
    like this
    201410
    Fall 2013
    If it returns 2 rows, I only get the fir one in the drop out menu 
    201410
    Fall 2013
    201420
    Spring 2014
    I try to put a loop but it does not work..
    I need to be able to display any term that is retrieve by the cursor  (can be more than one)
    Term Fall 2013
    Spring 2014
    PROCEDURE p_enter_term
    IS
    v_code  stvterm.stvterm_code%TYPE;
    v_desc   stvterm.stvterm_desc%TYPE;
    CURSOR select_term_c IS
    SELECT
    stvterm_code,
    stvterm_desc
    from
    stvterm,
    sobterm
    where
    sobterm_dynamic_sched_term_ind = 'Y'
    and sobterm_term_code = stvterm_code;
    select_term_rec  select_term_c%rowtype;
    BEGIN
    --check for open cursor
    if select_term_c%isopen
    then
    close   select_term_c;
    end if;
    open    select_term_c;
    fetch select_term_c into v_code,v_desc; 
    HTP.p ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
       HTP.p ('<FORM ACTION="/test/btsewl.p_sel_crse" METHOD="POST" onSubmit="return checkSubmit()">');
       HTP.p ('<TABLE  CLASS="dataentrytable" summary="This layout table is used for term selection."width="50%"><CAPTION class="captiontext">Search by Term: </CAPTION>');
       HTP.p ('<TR>');
       HTP.p ('<TD class="dedefault"><LABEL for=term_input_id><SPAN class="fieldlabeltextinvisible">Term</SPAN></LABEL>');
       HTP.p ('<SELECT NAME="p_term" SIZE="1" ID="term_input_id">');
       HTP.p ('<OPTION VALUE="'||v_code||'">');
       HTP.p (v_desc);
        HTP.p ('</OPTION>');
       HTP.p ('</SELECT>');
       HTP.p ('</TD>');
       HTP.p ('</TR>');
       HTP.p ('</TABLE>');
       HTP.p ('<BR>');
       HTP.p ('<BR>');
       HTP.p ('<INPUT TYPE="submit" VALUE="Submit">');
       HTP.p ('<INPUT TYPE="reset" VALUE="Reset">');
       HTP.p ('</FORM>');
    END;

    You are using the Eclipse Dali plugin to generate tables from your entities, not the EclipseLink JPA provider at runtime, so the settings in your persistence.xml are ignored.  The documentation for the Dali table Wizards state it will drop and create tables.  If you want to use the EclipseLink persistence settings to just create tables, access your persistence unit in a test case or deployment. 

  • Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008

    I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
    row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the  grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
    report.

    Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
    So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
    "=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
    /IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
    Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
    Thanks.
    If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SSRS Get value of previous row in a matrix (cannot use previous function because it's a matrix)

    I have a SSRS report which uses a matrix for a crosstab effect.
    Each row contains about 10 score values in 10 columns respectively. I need each row to check against the previous row, and i need each score value in each column to be compared to the corresponding column score value in the previous row. 
    If the current score is greater than the corresponding previous score (in the previous row), then i want to change the background of the cell.
    if the current score is smaller than the previous, then it's a different color.
    if they are equal, or it's the first row in the matrix table, then leave white.
    I have found custom code functions to use in the SSRS expression fields, but every single one of them compares against the previous COLUMN value and not the previous ROW value which is what i need. the "Previous" function would be perfect if i
    could use it in a matrix but i can't. (i keep getting error "The use of a Previous aggregate function in a tablix cell is not supported"). looking around it turns out that matrices are arrange in groups and not in rows which is why Previous can't
    be used and the only way is with custom code.
    Please help. if you have any custom code samples that achieve what i need, please share, or give me advice on how to achieve this. 
    Thank you

    I figured it out. Maybe it can help someone else in the future:
    Public Shared count as Integer = 0
    Public Shared currentRow As Integer = 1
    Public Shared MatrixStructures As New System.Collections.Generic.List(Of MatrixStructure)()
    Public Shared Function GetCellColor(row as Integer, score as Integer)
    If (row > currentRow) Then
    count = 0
    currentRow = row
    End If
    count = count + 1
    Dim matrixStructure As New MatrixStructure()
    matrixStructure.RowIndex = row
    matrixStructure.ColumnIndex = count
    matrixStructure.ScoreValue = score
    MatrixStructures.Add(matrixStructure)
    If score = 0 Then
    Return "White"
    End If
    Dim val As MatrixStructure = MatrixStructures.Find(Function(s As MatrixStructure)
    Return s.GetRowIndex() = row - 1 AndAlso s.GetColumnIndex() = count
    End Function)
    If (Not (val Is Nothing)) Then
    If val.scoreValue = 0 Then
    Return "White"
    End If
    If score >= val.scoreValue + 2 Then
    Return "Green"
    ElseIf score <= val.scoreValue - 2 Then
    Return "Red"
    End If
    End If
    Return "White"
    End Function
    Public Class MatrixStructure
    Public rowIndex As Integer
    Property GetRowIndex() As Integer
    Get
    Return rowIndex
    End Get
    Set(ByVal Value As Integer)
    rowIndex = Value
    End Set
    End Property
    Public columnIndex As Integer
    Property GetColumnIndex() As Integer
    Get
    Return columnIndex
    End Get
    Set(ByVal Value As Integer)
    columnIndex = Value
    End Set
    End Property
    Public scoreValue As Integer
    Property GetScoreValue () As Integer
    Get
    Return scoreValue
    End Get
    Set(ByVal Value As Integer)
    scoreValue = Value
    End Set
    End Property
    End Class
    and to pass the current row number from the expression i use this
    Ceiling(RowNumber(NOTHING) / 10)
    i divide the row number by 10 because there are ten columns. if you don't know the number of columns, or it's a variable number, then return it from the stored procedure query in the first place. that's what I had to do

  • Ordering and Reordering rows in a Matrix

    Hi,
    I am using a DBDataSource (User Defined) to populate a Matrix.
    I use Conditions to filter this matrix.
    I have a field called Seq in the Matrix and want to be able to order the matrix by Seq.
    Can this be done without using a SQL Query in the datasource.
    Also I have up and down buttons next to the Matrix - is there a way to move rows up and down (or reorder the rows) in the matrix without changing a code and requerying the Datasource ?
    Thanks
    Nick
    Pages: 1

    Hi Dragos,
    Hope this can help.
    In my form I have 2 matrix's that need reordering, and I have 2 buttons next to each up1/dn1 and up2/dn2
    Here is the event code :
    Private Sub FLBOM_ItemPress(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByVal oform As SAPbouiCOM.Form)
            Dim s As Integer = 0
            'Dim oform2 As SAPbouiCOM.Form
            'oform2 = SBO_Application.Forms.Item("FLBOM")
            Try
                If pVal.Before_Action = True Then
                    Select Case pVal.ItemUID
                        Case "up1"
                            FLBOM_MoveRow(pVal, oform, "matBOM", Direction.Up)
                        Case "dn1"
                            FLBOM_MoveRow(pVal, oform, "matBOM", Direction.Down)
                        Case "up2"
                            FLBOM_MoveRow(pVal, oform, "matSubBOM", Direction.Up)
                        Case "dn2"
                            FLBOM_MoveRow(pVal, oform, "matSubBOM", Direction.Down)
              End Select
                End If
            Catch ex As Exception
                MessageBox.Show("s=" & s.ToString & ":" & ex.Message)
            End Try
        End Sub
    I also pin this to the itempress event on the matrix itself - if the user selects the top row of the matrix
    it disables the up button, bottom of the matrix disables down button
          If pVal.FormMode = 1 Then
                                    Dim m As SAPbouiCOM.Matrix = oform.Items.Item("matBOM").Specific
                                    Dim r As Integer = pVal.Row
                                    Dim rc As Integer = m.RowCount
                                    Select Case r
                                        Case 1
                                            FLBOM_ItemEnable(oform, "up1", True)
                                            FLBOM_ItemEnable(oform, "dn1", False)
                                            FLBOM_ItemEnable(oform, "btnBOMDel", False)
                                        Case rc
                                            FLBOM_ItemEnable(oform, "up1", False)
                                            FLBOM_ItemEnable(oform, "dn1", True)
                                            FLBOM_ItemEnable(oform, "btnBOMDel", False)
                                        Case Else
                                            FLBOM_ItemEnable(oform, "up1", False)
                                            FLBOM_ItemEnable(oform, "dn1", False)
                                            FLBOM_ItemEnable(oform, "btnBOMDel", False)
                                    End Select
    ItemEnable looks like this
    Private Sub FLBOM_ItemEnable(ByVal oform As SAPbouiCOM.Form, ByVal Itm As String, ByVal Off As Boolean)
            Dim e As SAPbouiCOM.Item
            e = oform.Items.Item(Itm)
            If Off Then
                e.Enabled = False
            Else
                e.Enabled = True
            End If
        End Sub
    Then I have code to handle the moving of the rows - it is fairly generic - you feed it the form, matrix name and the direction and the code does the rest.
    You need to change the SQL to update the right UDT
    The matrix name(s) - remember I have 2 on the same form that I reorder so this code could easily be simplified.
    Private Sub FLBOM_MoveRow(ByVal pval As SAPbouiCOM.ItemEvent, ByVal oform As SAPbouiCOM.Form, ByVal Mat As String, ByVal dir As Direction)
            If pval.FormMode = 1 Then
                Dim oMatrix As SAPbouiCOM.Matrix = oform.Items.Item(Mat).Specific
                Dim irow As Integer
                Try
                    irow = oMatrix.GetNextSelectedRow(0, SAPbouiCOM.BoOrderType.ot_SelectionOrder)
                    If irow = 1 And dir = Direction.Up Then
                        SBO_Application.StatusBar.SetText("Cannot Go Up ", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                        Exit Sub
                    End If
                Catch
                    SBO_Application.StatusBar.SetText("Must Select a Line in First", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    Exit Sub
                End Try
                If irow < 0 Then
                    SBO_Application.StatusBar.SetText("Must Select a Line First", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    Exit Sub
                End If
                ' CODE HERE
                Dim oTbl As SAPbouiCOM.DataTable
                Dim sSql As String
                Dim Seq1 As Integer
                Dim Seq2 As Integer
                Dim code1 As String
                Dim code2 As String
                Dim oe As SAPbouiCOM.EditText
                oe = oMatrix.Columns.Item("colSeq").Cells.Item(irow).Specific
                Seq1 = oe.Value
                oe = oMatrix.Columns.Item("#").Cells.Item(irow).Specific
                code1 = oe.Value
                Select Case dir
                    Case Direction.Up
                        code2 = oMatrix.Columns.Item("#").Cells.Item(irow - 1).Specific.value
                        Seq2 = oMatrix.Columns.Item("colSeq").Cells.Item(irow - 1).Specific.value
                    Case Direction.Down
                        code2 = oMatrix.Columns.Item("#").Cells.Item(irow + 1).Specific.value
                        Seq2 = oMatrix.Columns.Item("colSeq").Cells.Item(irow + 1).Specific.value
                End Select
                oTbl = oform.DataSources.DataTables.Item("TEMPTable1")
                sSql = "UPDATE [@LYNXS_SP] SET U_Seq=" & Seq2 & " WHERE Code = '" & code1 & "'"
                oTbl.ExecuteQuery(sSql)
                sSql = "UPDATE [@LYNXS_SP] SET U_Seq=" & Seq1 & " WHERE Code = '" & code2 & "'"
                oTbl.ExecuteQuery(sSql)
                If Mat = "matBOM" Then
                    FLBOM_After_CFLBP(oform)
                Else
                    Dim om1 As SAPbouiCOM.Matrix = oform.Items.Item("matBOM").Specific
                    Dim e As SAPbouiCOM.EditText = om1.Columns.Item("#").Cells.Item(irow).Specific
                    LoadSubBom(e.Value, oform)
                End If
                Select Case dir
                    Case Direction.Up
                        irow = irow - 1
                    Case Direction.Down
                        irow = irow + 1
                End Select
                oMatrix.SelectRow(irow, True, False)
                Dim rc As Integer = oMatrix.RowCount
                Select Case irow
                    Case 1
                        FLBOM_ItemEnable(oform, "up1", True)
                        FLBOM_ItemEnable(oform, "dn1", False)
                    Case rc
                        FLBOM_ItemEnable(oform, "up1", False)
                        FLBOM_ItemEnable(oform, "dn1", True)
                    Case Else
                        FLBOM_ItemEnable(oform, "up1", False)
                        FLBOM_ItemEnable(oform, "dn1", False)
                End Select
                Try
                    If Mat = "matBOM" Then
                        Dim e As SAPbouiCOM.EditText = oMatrix.Columns.Item("#").Cells.Item(irow).Specific
                        LoadSubBom(e.Value, oform)
                    End If
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
            Else
                SBO_Application.StatusBar.SetText("Must Update Form First", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
            End If
        End Sub
    So Finally - here are the 2 routines that load the matrix - notice I use the same routines to initially load the matrix as I do after the above updates when the row is moved.
    Private Sub FLBOM_After_CFLBP(ByVal oform As SAPbouiCOM.Form)
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim oMatrix2 As SAPbouiCOM.Matrix
            oMatrix = oform.Items.Item("matBOM").Specific
            Dim oe As SAPbouiCOM.EditText = oform.Items.Item("3").Specific
            Dim oc As SAPbouiCOM.ComboBox = oform.Items.Item("cbArea").Specific
            Dim SQLSTR As String = "SELECT * FROM [@LYNXS_SP] WHERE U_PARENTCODE IS NULL AND U_CARDCODE = '" & oe.Value & "' AND U_AREAID = '" & oc.Selected.Value & "'  ORDER BY U_AREAID, U_SEQ"
            oform.DataSources.DataTables.Item("TEMP").ExecuteQuery(SQLSTR)
            oMatrix.LoadFromDataSource()
            oMatrix2 = oform.Items.Item("matSubBOM").Specific
            oMatrix2.Clear()
        End Sub
    and
    Private Sub LoadSubBom(ByVal ParentID As Integer, ByVal oform As SAPbouiCOM.Form)
            Dim m As SAPbouiCOM.Matrix = oform.Items.Item("matSubBOM").Specific
            m.Clear()
            Dim SQLSTR As String = "SELECT * FROM [@LYNXS_SP] WHERE U_PARENTCODE = '" & ParentID & "' ORDER BY U_SEQ"
            oform.DataSources.DataTables.Item("TEMP").ExecuteQuery(SQLSTR)
            m.LoadFromDataSource()
        End Sub
    one last bit of code that is missing from the above
        Public Enum Direction
            Up
            Down
        End Enum
    Let me know how this goes for you.
    Regards,
    Nick

  • Disabling a cell or a row in a matrix

    1.is there a way to disable a cell in a matrix?
    2.is there a way to disable a row in a matrix?
    3.is there a fast way to disable all the controls on a form as a result of a checkbox change?
    rgds
    Hagai

    1) Yes
    <b>Code (C#):</b>
    // Get the item properties of a cell
    SAPbouiCOM.Item oItem = (SAPbouiCOM.Item)oMatrix.Columns.Item("LOC_CODE").Cells.Item(1);
    // Disable the cell
    oItem.Enabled = false;
    <i>Notes:
    - oMatrix is my matrix object
    - LOC_CODE is a column name in my matrix
    </i>
    2) Probatly... It can be done for each column as I described above, but there could be a better alternative?
    3) I guess not, you should disable all controls one by one

  • Columns adjustment in one row

    Hello,
    I hope some1 can help me for these.
    I am using apex 3.1.2 ver
    My first question: how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?
    e.g
    aaaaaaaaaaaaaaa( ) bbbbbbbbbbbbbb ( ) ccccccccccccccccc ( ) ddddddddddd( )
    second question?
    how can i display second column value based on first column value before saving the page?
    e.g. aaaaaaa(1) bbbbbbbb(should display text value based on first column)
    for example 1 - abc
    2 - def
    3 - ghi and so on.
    last question? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?
    Many thx.
    kind regards,

    Irha10 wrote:
    how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?In item property change "Begin on new Line " to "Yes"
    Irha10 wrote:
    how can i display second column value based on first column value before saving the page?01. You have to create a branch to same page
    02. Submit the page using any event (such as button press or something). So when you enter details to first item and then press button then page will submit and reload the same page.
    03. In the page create a before region process and check whether second item is not null and third item is null then populate third item. Then first item is not null and second item null then populate second item.
    Irha10 wrote:
    ? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?You can use a java script and enable and dissable item based on any condition such as value of another item
    Example
    if ($x('P16_YYY').value !='SOME VALUE')
      $x('P16_XXX').disabled = true;
    }else
      $x('P16_XXX').disabled = false;
    }

  • Displaying records in one row??

    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34I had written a query(splitting KBIM code data & PBIM code data which actually brought back results as seen below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     NULL     NULL
    NULL     NULL     Y     B1234I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234

    Hi,
    francislazaro wrote:
    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34...
    I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234
    So you don't want anything in the results about userrecordids 'm002' and 'm003', because they do not have both board_codes 'KBIM' and 'PBIM', is that it?
    One way to get those results is a self-join, as if all the rows with borad_code 'KBIM' were in one table, and all the rows with borad_code 'PBIM' were in another:
    SELECT     'Y'          AS "KBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    ,     'Y'          AS "PBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    FROM     boards     k
    JOIN     boards     p     ON     k.userrecordid     = p.usrrecordid
    WHERE     k.board_codes     = 'KBIM'
    AND     p.board_codes     = 'PBIM'
    ;Another way is a GROUP BY, like Mpautom suggested.
    If your requirements change in the future, so that you need to include all rows, even if they don't have both board_codes, then you could change the JOIN to a FULL OUTER JOIN and make what I wrote as the WHERE clause part of the join condition, but I suspect the GROUP BY approach would be more efficient in that case.

  • Adding Just One Row at a Time

    Multiple users can add Comments to a table, once added, the comments should be read only. How would I go about creating a region that will add just one row at a time, clear the region and then allow the adding of another row and not allow access to existing data rows?
    Jeff

    This example is doing exactly that:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Once added, the row can not be changed any more.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Update one row at a time, Data Grid

    Is it possible to update one row of a mx:DataGrid at a time.  I want to be able to have a user push a button and info populates one row of the data grid, user changes some properties and pushes the button again and another row of values populate the DataGrid.  Everything I see does a mass population from an XML or what have you.
    Thanks

    I did this this to work, so for those of you who may find this info helpfull here is how I solved the issue.
    I instantiated an ArrayCollection object like so:
    private var _rowValues:ArrayCollection = new ArrayCollection();
    I simply referenced the .addItem() property of my ArrayCollection.
    I then added values to the ArrayCollection as follows
    _rowValues.addItem({Ingredient:ingredient, Amount:amount, Category:category}); //dataField:value
    and referenced the dataField proerpty of the DataGrid... so in my case my 3 dataField properties (in my mxml compontent) were as fillows:
    dataField="Ingredient"
    dataField="Amount"
    dataField="Category"
    all done, and it works.

  • How can I delete the last row of a Matrix

    Hi All,
    Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!
    I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):
    ==
    if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))
      if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)
        if (evnt.BeforeAction)
          form = BusinessOne.Application.Forms.Item(formUID);
          mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;
         int numRow = getSelectedRow(mtx);
         if (numRow != -1)
                                            mtx.DeleteRow(numRow);
                                            form.Mode = BoFormMode.fm_UPDATE_MODE;
                                       Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);
                                       btn.Enabled = true;
    ==
    Cheers,
    Marcel Peek
    Alpha One
    Message was edited by: Marcel Peek
    Message was edited by: Marcel Peek

    Yes, there is a problem to delete the last row.
    It is fixed in version 2005.

Maybe you are looking for

  • Acrobat Pro 9.51 Hangs When Printing to PDF from WordPerfect.

    Seems Adobe Acrobat 9.51 is hanging when attempting to do a conversion to PDF by printing to PDF from WordPerfect (using X3/X5).  Problem is it also hangs the rest of the PC.  Have to attempt to kill the process (though it is so slow I end up having

  • Want to change podcast artwork: not showing up in iTunes Store

    Hi. I want to change the icon/artwork for my podcast. My website (created with iWeb) = www.manleywoman.com My podcast in iTunes Store = Manleywoman SkateCast I use Garageband to create my podcast, then save to iWeb, then save to iTunes. So I changed

  • Some HTML emails get corrupted in Mail.app

    I get a lot of HTML emails and just occasionally Mail.app seems to mangle the headers and think the mail is plain text, which means the attachments are useless. I then have to resort to Thunderbird to read the email. The corrupted emails usually star

  • ORA-01578: ORACLE data block corrupted on tables in sysaux tablespace

    Dear Experts, From the alert log file we noticed data block corruptions on one of our datafiles. After further investigation, we realized that the corruptions were on 3 of the AWR related tables in the SYSAUX tablespace: 1. WRH$_LIBRARYCACHE 2. WRH$_

  • Multi-line Label inside VBox gets overlapped

    I don't know if it's a bug or a "feature", but I have something like the following: VBox {         content: bind [Label,         Hyperlink] }The text inside the label has a line break in it. Now the problem is that the layout manager ignores the fact