How to do addition of two columns cells in Matrix.

Hi All,
I tried following code on LostFocus event of Mtrix. I want to do addition of two columns cells of matrix and addtion display in third column. I tried the following code but in this I am getting the column value and when i enterd any value in columns cells it disappear when i move to next column cells.
Can anybody suggest me how to do it ?
Dim i As Integer
            Dim v1, v2 As String
            matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds")
            If pVal.ColUID = "V_4" Then
                For i = 0 To matrix.RowCount - 1
                    v1 = matrix.Columns.Item("V_5").Cells.Item(i + 1).Specific.Value
                    v2 = matrix.Columns.Item("V_4").Cells.Item(i + 1).Specific.Value
                    Dim v3 As Integer = CInt(v1) + CInt(v2)
                    matrix.Columns.Item("V_3").Cells.Item(i + 1).Specific.Value = v3.ToString()
                Next
            End If
Thanks and Regards,

Hi,
u bind all the columns to the datasource in the matrix.then the value does not disappear.
Change ur code as follows:
Use the databind in formload
matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds1")
matrix.Columns.Item("V_5").DataBind.SetBound(True, "", "matrixds2")
matrix.Columns.Item("V_3").DataBind.SetBound(True, "", "matrixds3")
Dim v1, v2 As sapbouicom.edittext
If pVal.ColUID = "V_4" Then
v1 = matrix.Columns.Item("V_5").Cells.Item(pVal.row).Specific
v2 = matrix.Columns.Item("V_4").Cells.Item(pVal.row).Specific
v3=  matrix.Columns.Item("V_3").Cells.Item(pVal.row).Specific
v3.Value = v1 .Value + v2.Value
End If
Kind Regards
Mohana

Similar Messages

  • (JTable) How can i get the first columns cell in a selected row?

    Hello. I am trying to figure out how i can get the first columns cell within a selected row no matter what cell is selected in that row. I have a class that extends AbstractTableModel which represents the table. Now i have another class that extends DefaultSelectionModel. Each model is added to the JTable via setModel(TableModel dataModel), setSelectionModel(ListSelectionModel newModel). Now i don't understand what i have to return from getMaxSelectionIndex(). Any ides? Thanks.
      class xTableModel extends AbstractTableModel{
         private static String[] cols;
         private Object[][] data;
            public void setTableModel(Object data[][], String[] cols){
             this.cols = cols;
             this.data = data;
            public String getColumnName(int col){
             return cols[col];
            public int getRowCount() {
             return data.length;
            public Object getValueAt(int row, int col) {
             return data[row][col];           
            public void setValueAt(Object value,int row,int col){
             data[row][col]=value;
            public int getColumnCount(){
             return cols.length;
    class ColumnListenerModel extends DefaultListSelectionModel{
         public int getMaxSelectionIndex(){}

    int row = table.getSelectedRow();
    Object data = table.getValueAt(row, 0);

  • How best to display a two column menu in Flash 8?

    I have a flash 8 template and i am using Macromedia Flash Professional 8. I want to create a menu in a scrollable text box, which has two columns exactly aligned like so:
    Lamb                                                   £2.30                       Chicken                                                      £2.30                                                
    Minced lamb with onions, herbs,                                           Minced chicken with an mixture of
    in egg yolk and shallow fried.                                                green chillies cooked over a charcoal grill on
    Kebab                                                  £2.80                       Lamb                                                         £2.40
    A mix of chicken kebab, seekh kebab and                             Minced lamb mixed with gram flour, spices, green
    shami kebab.  Served on a sizzler.                                        chillies and herbs then deep fried.
    However, when i test the movie there is no formatting and the text is misaligned. I already have the above text (and there is alot of it) in the exact format, in a word file, so i could copy and paste the text instead of writing it out all over again.
    I have been advised that it is better to use the Datagrid component to display the above text in a table?
    My question is, how can i use the Datagrid component to display the text aligned exactly as above? Do i need to create html tables and then get the datagrid component to call this html file, xml file or actionscript? I am not familiar with xml or actionscript.
    Please can someone help?
    Thank you.

    Hi Ned. Apologies for late reply. Been away.
    Anyway, i have created an image of what it is i need. Please see the image below - menu.gif
    Not sure what the easiest way is to create such a two column menu in Flash because the tab key on the keyboard does not work in a scrollable textbox only the space bar. And using the space bar does not align the text correctly.
    However, i do have a html file which i created using html tables. Is there a way to import the html file into a scrollable textbox in flash? The raw html code example is a little different as i have included the borders, but the idea is the same - a two-column scrollable menu.
    Any help would be greatly appreciated.
    <html>
      <head>
        <title></title>
      </head>
      <body>
        <table width="50%" border="1">
          <tr>
            <td>
              <table width="100%" border="1" cellpadding="2"
              cellspacing="0">
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
              </table>
            </td>
            <td>
              <table width="100%" border="1" cellpadding="2"
              cellspacing="0">
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </body>
    </html>

  • How to make RDLC report two column

    Hello. I have a simple report which is supposed to be used for printing stickers. The sticker paper is A4 size and it has two columns. I successfully managed to print data to left column. I also want to print data to right column too. My current report looks
    like this :
    [Title]
    [NameLastName]
    [Address]
    How can I make my report to fill data to two columns? Thanks in advance.

    Thank you for your response. Here is what I have :
    Here is what I need :
    Thank you very much.

  • How can I create a two columns zone in a Pages document without making all of the document two columns?

    I have a Pages document with 4 paragraphs. I want the first one to be separated in two columns, but just this one.

    Click in the text where you want this:
    Menu > Insert > Layout Break twice.
    Between those breaks:
    Inspector > Layout > Layout > Columns: 2
    Peter

  • How to find differences between two columns

    Hello I need the formula to spot differences between two columns and to write on a third one if the same name appear on the two columns.
    For example:
    rome berlin true
    berlin moscow false
    chicago toronto true
    toronto chicago true
    florence
    Thanks
    Lorenzo

    You should be able to use COUNTIF where the range is th first column and the condition is the word in the second column. If the result is greater than zero then the word is in both columns.

  • SSRS difference of last two columns of a matrix

    hi i have design a report like this 
    ITEM 
    Jun-14 
    july-14 
    aug-14 
    sep14 
    Indicator 
    Volume 
    Volume 
    Volume 
    Volume 
    name pass 
    12 
    12 


    same 
    adress pass 
    10 



    up 
    DOB pass 


    42 
    23 
    down 
    Marriage pass 



    nodata 
    arrow invisible 
    Sum 
    30 
    19 
     30
     19
     58
     39
     down
    i want to have a report like this in which indicator is showing the difference between last two month difference and showing arrow going up or down 
     based on last two month value in matrix. 

    Refer this link,
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/be3e6d81-cd79-44cf-98e8-b23ef13afa36/how-to-add-calculated-column-from-dynamic-columns-to-a-matrix?forum=sqlreportingservices
    Regards, RSingh

  • How to concatinate values of two columns and update into another column

    There is a table : TEST contains three columns - Column1 , Column2 , Column 3
    Column1 contains values - (1,2,4)
    Column2 contains values : (a,b,c)
    Column 3 is empty .
    Target : Values in column 3 should be (1a,2b,4c)
    Need to achieve this through procedure .

    Paul if i want to concatenate two strings or alpha numeric characters from 2 fields and display in the third field,Will this code be able to do that?

  • How to wrap text in two columns and display as one in WAD

    Hi ,
    I have the following columns in my ODS , they are not KF's
    c1        c2    c3    
    100      AA      BB
    200      CC      DD   
    I need this display format
    100   AA
          BB
    200   CC
          DD
    I need to wrap the text in columns c2 and c3 and display them under one column.
    Is it possible in  webtemplate by using java scripting.

    IN the Query , you could diplay Characteristics as a Hierarchy. Just above the Columns Box in Bex, do a write click.
    Hope this helps

  • How to roundoff addition of two double variables

    class Example
         public static void main(String args[])
              double k=1.236+2.138;
              System.out.println(k);
    }output of program:
    3.3739999999999997
    so how will i get the exact value of the addition

    etgohomeok wrote:
    If you know it's going to be 3 decimal places every time, you could always do:
    double d1 = 1.236;
    double d2 = 2.138;
    int i1 = (int) d1 * 1000;
    int i2 = (int) d2 * 1000;
    int iResult = i1 + i2;
    double dResult = ((double) iResult) / 1000;You could collapse that into a couple of lines and eliminate alot of the variables, but that's the general point...Unfortunately, that gives the wrong answer. Try running it and see.

  • How to perform addition of two numbers in shell scripting in Solaris-10

    Hi,
    I have a sh script which contains the following line
    TOTAL=$((e4-s4)) -> Where e4 and s4 are input got from the user.
    At the time of execution of this line the following error occurs
    test.sh: syntax error at line 8: `TOTAL=$' unexpected
    How to solve this issue?. Can any one help me please?.........................
    Regards
    Revathi

    Again Same error persisted.
    Below is my script
    +#!/bin/bash+
    echo "Enter the start IP"
    IFS="."
    read s1 s2 s3 s4
    echo "Enter the End IP"
    IFS="."
    read e1 e2 e3 e4
    TOTAL=$(($e4 - $s4))
    echo "Total is $TOTAL"
    The output is
    *#!/bin/bash*
    echo "Enter the start IP"
    IFS="."
    read s1 s2 s3 s4
    echo "Enter the End IP"
    IFS="."
    read e1 e2 e3 e4
    TOTAL=$(($e4 - $s4))
    echo "Total is $TOTAL"
    Any idea

  • How can I sort two columns?

    I've got two columns of text (names of people, actually) in a Numbers spreadsheet. I've selected all the cells and made sure they are "text" format. I cannot figure out how to sort (alphabetically) the two columns independent of one another.
    I just want two columns of names in alphabetical order. How do I do it? Every time I select one column and sort by ascending it affects the column(s) next to it.

    Not sure I totally understand the actual question. But let me give it a shot...
    Column A = Last Name, Column B = First Name. You want to sort this list of names by Last Name, then by First Name so John Smith shows up below Alex Smith on your list. Typically you would have MULTIPLE columns of data to go along with the names; Phone, Address, City, State, Zip, etc. Right? So if you Sort only ONE column (and ONLY that column, you end up with John Smith having the wrong address, etc. etc. SO, most Spreadsheets allow you to sort multiple columns at the same time, but by only one Column Title at a time. This keeps the rest of the data in the Record in the right place. Thus, you sort Column A (Last Name) in Asending order. Now all the LAST Names are alphabetical. Next, you sort Column B (First Name) in Asending order. Now the list should show up with the last Names in the correct order, AND the First Names also - BUT all the other info (address, City, State, etc) is ALSO still attached to the right records. Clear as MUD?!
    P.S. This will ONLY work when your Title Box for each Column has a SINGLE Line of text:
    Like THIS: Last Name
    NOT THIS: Last
    Name
    The Spreadsheet will leave the TOP ROW (Titles) alone, and sort the Rows beneath the Title Boxes.
    Good luck...

  • Split one column value into two columns using t-sql

    Hi All,
    I have one varchar column in a table.
    Col1
    ABC-12C4
    BC-A345
    CD
    XYZ
    How to split this into two columns like this using t-sql
    Col1   Col2
    ABC    12C4
    BC      A345
    CD     
    XYZ
    Thanks,
    RH
    sql

    assuming a static delimiter, and the split will end up with a max of 2 columns, something like this would work.  basically you just need to determine where the delimiter is, and then use the left and right functions to find the 2 pieces.
    declare @t table(value varchar(10))
    insert into @t(value)
    values
    ('ABC-12C4'), ('BC-A345'), ('CD'), ('XYZ')
    select
    case
    when charindex('-', value) != 0 then left(value, charindex('-', value) - 1)
    else value
    end as col1,
    case
    when charindex('-', value) != 0 then right(value, len(value) - charindex('-', value))
    else ''
    end as col2
    from @t

  • How do I count the unique value pairs in two columns of a table?

    I have a table (Table 2) that is populated with data from an imported .csv file. On table 1 I need to count the unique value pairs in two columns of Table 2.
    Here's what I have:
    Date                                        Person
    7/10/2011                         A
    7/12/2011                         W
    7/12/2011                         X
    7/12/2011                         X
    7/12/2011                         X
    7/12/2011                         Z
    7/14/2011                         Z
    7/15/2011                 X
    7/16/2011                         Z
    I'm focusing on person "X" and can easily count how many days that person shows up but what I want is to see on how many unique days that person shows up.
    Here's the result I'm looking for (Person "X" shows up on 2 different days - 3 times on 7/12/2011 and once on 7/15/2011):
    X                    2
    I can't seem to find a function that allows me to do that. I also am not allowed to modify Table 2 so that leaves me to come up with a solution on Table 1.
    Any ideas would be greatly appreciated.

    Hi John,
    Not being allowed to modify Table 2 is a minor inconvenience. Just copy (using a formula) the necessary two columns onto Table 1.
    Yellow columns may be hidden. The procedure progresses from left to right. All formulas are entered into row 2 then filled down that column to the end of the table. The table must be as long as the list in column A of Table 2.
    A2: =Table 2::A
    Fill right to column B.
    Fill both columns down as far as needed.
    I've used actual Date and Time values in column A, formatted to show only the Date part, but the technique will work with text in these cells, provided all cells representing the same 'date' have exactly the same content.
    C2: =A&B
    This concatenates the contents of each row of columns A and B into a single text string.
    D2: =COUNTIF($C$2:C2,C)
    This counts the number of occurrences of the Date&Name string on the current row from the first regular cell in column C (C2) to the current cell.
    E2: =IF(COUNTIF($B$2:B2,B)=1,MAX($E$1:E1)+1,"")
    This constructs the index of first occurrences of each name, in the order they first occur. The index is used by LOOKUP in column F.
    F2: =IF(ROW()-1>MAX(E),"",LOOKUP(ROW()-1,$E,$B))
    This uses the index value created in E as a search-for value to extract a single copy of the names in column B. The result is a list of all distinct names in the list. Note that spelling differences will be counted as distinct names.The IF statement stops the listing when the last distinct name is extracted.
    G2: =IF(LEN(F)>0,COUNTIFS($B,"="&F,$D,"=1"),"")
    This counts the number of 'first occurrences of distinct Date & Name strings for each name on the list (ie. the number of distinct dates on which each name appears in the original list).
    All of the functions used are described, with at least one example for each, in the iWork formulas and Functions User Guide. You can download the guide, and the Numbers '09 User Guide, via the Help menu in numbers.
    Regards,
    Barry

  • How do you get the sum of two columns multipied together?

    I can't seem to figure out how to get the sum of two columns multiplied together without having to manually type out each location (example: A1*B1+A2*B2+A3*B3, etc..).  Though the idea seems to be rather simple, everything I have tried has only given me an error.  I know there must be an easier way of doing this, but I get lost in the explanations given in 'help' area of numbers, can someone help me?

    C3=SUMPRODUCT(A3:A18, B3:B18)
    the function SUMPRODUCT() takes ranges and multiplies corresponding cells in the ranges, then adds them together.
    I the case I show SUMPRODUCT() performs:
    A3*B3 + A4*B4 + A5*B5 + A6*B6 + ... +  A18*B18
    If you want to perform the same operation on the whole column (s) you could modify the formula:
    C3=SUMPRODUCT(A, B)

Maybe you are looking for

  • Help needed - Field Mapping

    Hi, Detail: ======== I have a class called CustomerSpecificField extending another class NameValueTimestamp which contains 3 attibutes name, value, timestamp. In my package.jdo file when i tried to map my fields, I got the following exception. the at

  • Hyperlinks in illustrator work, export to pdf hyperlinks are gone...

    I created some figures in illustrator, added hyperlinks to the figures using the 'attributes' menu, added url etc. When clicking the object, i can see the url is appearing in the attributes window in illustrator. But, i want to export / save the illu

  • Print the amount in text number in one document

    Hi, I have one report in Crystal Report 10 , and i try to convert the amout to show me in text numbers, this application is to print one check and I need to print the amount in numbers in Text. I use this formula in my system but for some reason the

  • Does any1 know what generation an ipod touch is if its about 2-3 yrs old??

    a friend of mine is giving us her old ipod touch but she cant remember what generation it is she said shes had from new about 2-3 yrs ago can u help?? also if i were to restore it would i have a problem downloaded the new iOS update on it or is it no

  • LDAP schema for addressbook in Lion

    I am starting to setup an OpenLDAP server for the place where I work. So far everything has been good, but I need to add a couple more fields (attributes) than the one provided by the schema inteOrgPerson. I can add attributes to my accounts in LDAP