Order rows by cell value

Hi guys,
Trying to make a soccer scoreboard. I want to order the teams (Rows) so that the teams with the most points are on top. Anybody know if there is a way to do this?
Thanks,
Chris.

The old Swing tutorial on Dnd shows how to do this in the ExtendedDnDDemo example:
https://www.cs.auckland.ac.nz/references/java/java1.5/tutorial/uiswing/TOC.html
The DnD section has been rewritten for JDK6. I don't know if the new features make this easier or not:
http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Similar Messages

  • First Cell value in the first row of the structure not getting displayed

    Hi Friends,
                     We've got one structure at rows level, there as per our requirement i've taken around 12 "New Selections", that's ok i'm getting everthing fine, but whatever the new selection i put on the top of that structure in that, the First Cell Value for the first column not getting displayed...
                       I'm really wondering, this is the first time that i'm facing this kind of problem... what might be the reason & what is the solution for that...
    just awaiting for your inputs...
    Regards,
    Balaji Reddy K.

    There is no declarative way to do this as the table rows are stamped. This means there is no way to can access a value like (row+1).attributename
    So there is some coding needed. Check http://lucbors.blogspot.de/2012/02/adf-11g-fancy-master-detail-or-how-to.html and http://lucbors.blogspot.de/2012/02/adf-11g-even-fancier-multi-master-multi.html which might help you to implement your case.
    Timo

  • How to get selected Row/Cell value in i5Grid

    Hi Friends,
    Can anyone help to how to find the selected Row/Cell value of a i5Grid object. I am able to register the event handlers which are getting invoked on row/cell selection. But I want to know how can I get the value of selected Cell/Row. I would like to add selected Items from one i5Grid to another one.
    So want to know how can I get and set the value of i5Grid object.
    MII version 14.0 SP4 Patch
    Thank in advance
    Shaji Chandran

    Hi Shaji,
    Here is my code.
    <!DOCTYPE HTML>
    <HTML>
    <HEAD>
        <TITLE>Your Title Here</TITLE>
        <META http-equiv="X-UA-Compatible" content="IE=edge">
        <META http-equiv='cache-control' content='no-cache'>
        <META http-equiv='expires' content='0'>
        <META http-equiv='pragma' content='no-cache'>
        <SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-libs="i5Chart,i5Grid,i5SPCChart"></SCRIPT>
        <SCRIPT>
            var Grid = new com.sap.xmii.grid.init.i5Grid("STC/C5167365/i5Grid_TagQuery", "STC/C5167365/TagQuery");
            Grid.setGridWidth("640px");
            Grid.setGridHeight("400px");
            Grid.draw("div1");
        function setCellValue()
        Grid.getGridObject().setCellValue(1,1,"Set");
        function setCellValueAgain()
        Grid.getGridObject().setCellValue(1,1,"Changed Again");
        </SCRIPT>
    </HEAD>
    <BODY>
        <DIV id="div1"></DIV>
        <INPUT type="Button" value="setCellValue" onClick="setCellValue()"/>
        <INPUT type="Button" value="setCellValueAgain" onClick="setCellValueAgain()"/>
    </BODY>
    </HTML>
    Regards,
    Sriram

  • Is it possible to auto-populate a row of cells based on a pop-up value...

    ... that references a value from a column of another table?

    EDIT: I note that Jerry has posted much the same solution about the time I was called for dinner (followed by part 2 of the mini series we started watching last night). I'll leave this one up for the tutorial aspects. Other than the use of pop-up menus in Table B, they're essentially the same.
    Also, I see I highlighted the wrong ground beef row on the Ingredient table. The correct (93%) one is the one transferred to the second table. Oops!
    Barry
    dlconnolly wrote:
    Good Point, should have done that in the first place. Also, thank you very much for giving this a shot to help me out. Below are my tables that I am trying to link (they did not post as tables so I hope that doesn't further confuse the situation).
    Goal: In Table B/Recipes, I would like a drop-down/pop-up option in the 'Ingredient/Column A' column. Based on the choice of ingredient, I would like the Fat/Carbs/Protein row of cells for that ingredient to auto-populate with the data drawn from Table A/Ingredients.
    I used the LOOKUP function: =LOOKUP(A2,Ingredients :: Asparagus:'Turkey Breast ', {Ingredients :: B2:D23}). The error message I get is: "B2:D3}" isn't a valid reference.
    Hi dl,
    Looks like the problem is in the formula above. (repeated with comments below)
    <PRE>
    Table A: "Ingredients"
    Ingredient Fat Carbs Protein
    Asparagus 0 5 3
    Blueberries F 0 10 1
    Blueberries R 0 21 1
    Broccoli    0 6 2
    Chicken Bre 9 13 35
    Chickpeas 3 27 6
    Cous Cous 0 36 6
    Eggs        10 2 12
    Grapes     0 16 1
    Green Beans 0 10 2
    Ground Beef 90% 9 0 21
    Ground Beef 93% 6 0 25
    Mozz nonfat 0 4 32
    Mozz par tsk 16 3 24
    Olive Oil 14 0 0
    Pork, ground 18 0 22
    Quinoa     4 20 4
    Sour Cream 2 1 0
    Spinach    1 5 4
    Turkey Breast 0 4 20
    Table B: (end product)
    Ingredient Fat Carbs Protein
    Grnd Bf 93% 6 0 25
    Broccoli    0 6 2
    Quinoa     4 20 4
    </PRE>
    Posting a screen shot is easier than getting a table to align itself properly here, as the forum software must be forced into recognizing tabs as tabs. Screen shots must be hosted elsewhere (eg. Photobucket, Picasa, Flickr), then the HTML link supplied by the hosting site (on some sites in a "Share this" menu) can be entered into your post to call the image. Be sure to check the Preview tab here (before posting) to see what your post will look like.
    Here's your LOOKUP formula. I've replaced the square brackets, parsed by the forum to indicate a link, with curly brackets so they would be visible.
    =LOOKUP(A2,Ingredients :: Asparagus:'Turkey Breast ', {Ingredients :: B2:D23}).
    The error message I get is: "B2:D3}" isn't a valid reference
    "B2:D23}" perhaps?
    LOOKUP is discussed on p 217 of the iWork Formulas and Functions User Guide.
    It's syntax is:
    LOOKUP(search-for, search-where, result-values)
    So your formula,in English reads:
    Search for: the contents of cell A2 (on this table)
    In: the Table "Ingredients" in the columns "Asparagus" to "Turkey Breast"
    and return the results in the same row in the columns from B to D in the rows 2 to 23}
    I get an (expected) "invalid reference" message for Asparagus:'Turkey Breast '
    (Possibly due to my leaving 'use headers as column and row references' unchecked)
    Replacing that with the range in which the ingredients are listed (A2:A21), the error message changes to the one you quote.
    Even ignoring the square brackets, D23 is an invalid reference on my table, which ends with "turkey breast" in row 21. But even with the specified range completely on the table, the Invalid reference message remains, indicating the square bracket is a problem.
    My assumption is that it's there because you are attempting to define the results range as an array including all three columns from which you wish to gather results. Won't work.
    From p 217 of the iWork F&F User Guide:
    Usage Notes
    Both search-where and result-values are normally included and *are specified as either*
    *multiple columns or multiple rows, but not both* (one dimensional). However, for
    compatibility with other spreadsheet applications, search-where can be specified as
    both multiple columns and multiple rows (two dimensional) and result-values can
    be omitted.
    Editing to limit the result value array to a single column, and removing the square brackets gives a working formula for cell B2 on Table B:
    =LOOKUP(A2,Ingredients :: A2:A21, Ingredients :: B2:B21)
    Three further edits to the formula are needed before filling down and right to the rest of the active cells in Table B.
    The first is to make the column, but not the row, absolute in the cell address for search value so that this reference changes as the formula is filled down, but not as it is filled right.
    The second is to make both the columns and rows of the cell addresses specifying the search range absolute so that this range does not change as the formula is filled down, then right.
    The third is to make the rows (only) absolute in the result range so that they do not change as the formula is filled down, but do change as it is filled right, ensuring that we retrieve the values from the correct column of "Ingredients" to the corresponding column of Table B.
    These are done using the menu revealed by clicking the triangle that appears on the cell range reference when the mouse is placed on it in the formula bar. When done, the formula should look like this:
    =LOOKUP($A2,Ingredients :: $A$2:$A$21, Ingredients :: B$2:B$21)
    Finishing touch:
    As is, the formula will return error messages in rows where there is no entry in column A of Table B. To eliminate those, trap the error using IFERROR:
    =IFERROR(formula,"")
    (replace formula with the formula above, leaving off the = sign)
    Regards,
    Barry
    PS: The iWork Formulas and Functions Guide may be downloaded through the Help menu in Numbers. You'll also find the equally useful Numbers '09 User Guide at the same location. Both are highly recommended.
    B
    Message was edited by: Barry

  • Search Cell Values in iGrid and retrieving row values

    Hi,
    i want to retrieve particular row value in iGrid by making search for particular cell value. for example
    name   no
    ====   ==
    S1       1
    S2       2
    i want to retrieve all cell values for S2. but i dont know S2 row number and its also not selected row. without any selection i want pass S2 name into iGrid and want to retrieve no 2. how to do it?
    -senthil

    hi,
      Try following thing
    var gObj = document.GridName.getGridObject();
    var count = gObj.getRowCount();
    var result;
    for(i=1; i<=count; i++)
         var check = gObj.getCellValue(i,1);
         if (check == "S2")
              result= gOBJ.getCellValue(i,2);
    Here, "result" will store the value 2.
    Hope this helps.
    Regards,
    Musarrat

  • Dragging one cell value(copy) across columns or across rows in ALV layout

    Hi friends,
    In bps layouts, data is displayed in ALV grid as interface. At plng folder level, can i incorporate excel feature like dragging one cell value across columns or across rows?  Simply if user enter one value in cell of ALV grid, that should be copied automatically across rows/columns while dragging?
    Second question, even i chose in layout builder excel as interface, that layout showed in plng folder as ALV grid layout. Why it happens so. I read documentation in UPSPM of that particular plng folder, it tells same thing(even if u choose excel, it will show in ALV only). So how can i get excel interface in plng folder?
    Regards,
    Kumar

    requested property is not possible at ALV layout level. Provided text document load facility to user. So user can directly load excel to plng folder.
    Issue resolved.

  • How to add data through matrix from sales order row level to

    user defined document type table ...
    i created matrix in user defined form, i placed one edit text box on that form
    when i entered docnum of sales order the data of sales order row level should have to
    upload to matrix , after fill up the some data in matrix that data should have to add to the user defined document type table
                                any one have code pls post it
                                            thanq

    Hi rajeshwar
    Here is a sample function related to ur senario. just check it out and use the concepts.
    Here I have used a CFL to get the itemcode and I have used a query to  add data to matrix.
    This is a function used.
    Private Sub AddValuesInMatrix(ByRef name As String)
            Try
                'Dim quantemp As Double
                oForm = SBO_Application.Forms.Item("itemdts")
                oMatrix = oForm.Items.Item("matrix").Specific
                Dim rs As SAPbobsCOM.Recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                '//gitemdesc = "SELECT T0.[ItemName] FROM OITM T0 WHERE T0.[ItemCode] ='" & name & "'"
                oMatrix.Clear()
                rs.DoQuery("SELECT T0.[DocEntry], T0.[ItemCode], T0.[Dscription], T0.[Quantity], T0.[Price], T0.[TaxCode] FROM dbo.[POR1] T0 WHERE T0.[ItemCode] ='" & name & "'")
                rscount = rs.RecordCount
                If (rscount < 1) Then
                    SBO_Application.StatusBar.SetText("No Items Found", SAPbouiCOM.BoMessageTime.bmt_Short)
                Else
                    oForm.Freeze(True)
                    ITE = True
                    For i As Integer = 1 To rs.RecordCount
                        oMatrix.AddRow()
                        oMatrix.Columns.Item("V_5").Cells.Item(i).Specific.Value = rs.Fields.Item("DocEntry").Value
                        oMatrix.Columns.Item("V_4").Cells.Item(i).Specific.Value = rs.Fields.Item("ItemCode").Value
                        oMatrix.Columns.Item("V_3").Cells.Item(i).Specific.Value = rs.Fields.Item("Dscription").Value
                        oMatrix.Columns.Item("V_2").Cells.Item(i).Specific.Value = rs.Fields.Item("Quantity").Value
                        'quansum = quansum + rs.Fields.Item("Quantity").Value
                        oMatrix.Columns.Item("V_1").Cells.Item(i).Specific.Value = rs.Fields.Item("Price").Value
                        'pricesum = pricesum + rs.Fields.Item("Price").Value
                        oMatrix.Columns.Item("V_0").Cells.Item(i).Specific.Value = rs.Fields.Item("TaxCode").Value
                        SBO_Application.SetStatusBarMessage("Data Loading In Progress Please Wait.....>>> " & i & " / " & rs.RecordCount, SAPbouiCOM.BoMessageTime.bmt_Short, False)
                        rs.MoveNext()
                    Next
                    ITE = False
                    oMatrix.AutoResizeColumns()
                    SBO_Application.StatusBar.SetText("Data Loading Completed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
                    oForm.Freeze(False)
                    oForm.Refresh()
                End If
            Catch ex As Exception
                SBO_Application.MessageBox("Matrix Load Function : " & ex.Message)
                ITE = False
            End Try
        End Sub
    -Anto

  • Touble getting cell values from jTable

    Hi everybody, I need some hepl to understand this problem.
    I have jtable and I�m trying to get the values from the cells (first in the jOption panel then to jLabel and to jTextFields).
    All cell values are shown perfectly in the JOptionPanel.
    But I can�t get any values to the jLabel from the first column(0) no matter what row I press from the firts column.
    It gives me this error
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Integer
         at taulukko3.FTaulukko3.jTable1_mouseClicked(FTaulukko3.java:163)Here is my code where I think the problem is:
    public void jTable1_mouseClicked(MouseEvent e) {
       JOptionPane.showMessageDialog(this,jTable1.getValueAt(jTable1.getSelectedRow(),jTable1.getSelectedColumn()));
          try{
          int valittusarake = jTable1.getSelectedColumn();
           String tulos= "";
           if (valittusarake == 0) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                      jTable1.getSelectedColumn());
            jLabel1.setText(tulos);
           if (valittusarake == 1) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                       jTable1.getSelectedColumn());
             jTextField1.setText(tulos);
           if (valittusarake == 2) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                       jTable1.getSelectedColumn());
             jTextField2.setText(tulos);
    }

    Hi everybody
    I got it workin by making this change to my code:
          if (valittusarake == 0) {
             Object tulos1 = jTable1.getValueAt(jTable1.getSelectedRow(),jTable1.getSelectedColumn());
             jLabel1.setText(tulos1.toString());
          }

  • Right way to change datagrid row, column, cells background colors in code-behind?

    Hi all,
    I have a winform program that I'm upgrading to wpf (I'm new to wpf). The wpf code for the function (SetdataGridBackgroundColors()) is below with the winform code commented out so I can fix it.  I have a datagrid with a Cornsilk background color alteranating
    with LightGreen depending on the content of datetime  cell. If the day portion of the datetime is different then the color changes from one to the other. I used a colorIndex variable because at the end of the month it could go from 31 to 1 and that would
    not work if I use the day directly.
    I tried this line to change the background color:
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk);
    this works but it changes every row. I found this other stuff:
    DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    Either ContainerFromIndex or ContainerFromItem throw an exception because currentRowColor is null. I looked at optionsDataDatagrid.Items[i] and is not null. Then I read that using ItemContainerGenerator is not a good idea.
    BTW I'm calling SetdataGridBackgroundColors() after datagrid is been filled with data.
    So... what is the proper way to set each row, column or cell background color in wpf?
    Thanks
    private void SetdataGridBackgroundColors()
    optionRowData rowData = new optionRowData();
    if (optionsDataDatagrid.Items.Count == 0)
    return;
    int colorIndex = 1;
    DateTime savedDate, currentRowDate;
    rowData = optionsDataDatagrid.Items[0] as optionRowData;
    savedDate = rowData.col_datetime.Date; //only compare the date not the time
    for (int i = 0; i < optionsDataDatagrid.Items.Count; i++)
    //currentRowDate = Convert.ToDateTime(optionsDataDatagrid.Rows[i].Cells[3].Value); //winform code
    //currentRowDate = currentRowDate.Date; //winform code
    rowData = optionsDataDatagrid.Items[i] as optionRowData;
    currentRowDate = rowData.col_datetime.Date;
    if (currentRowDate != savedDate)
    colorIndex++;
    savedDate = currentRowDate;
    if (colorIndex % 2 == 0)
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.Cornsilk;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk); //this changes all rows
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    //currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.DarkSalmon;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.Aquamarine;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);
    else
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.LightGreen); //this has no effect
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.Coral;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.LimeGreen;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);

    I (also) strongly recommend mvvm.
    Setting values is a particularly bad idea in this case.
    I don't mean to be rude but your explanation of the requirement is kind of vague.
    I would bind solidcolourbrushes.
    Set the properties based on whatever your logic is within the viewmodel.
    You can switch out what each of the brushes holds when the user clicks wherever.
    So you use a highlightbrush when something or other is true.
    That highlightbrush is set to a blue brush when the user clicks left and a red brush when they click right.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • How to update a specific cell value in a CSV file.

    Hi
    I would like to know whether it is possible in openscript to update a cell value of the CSV file.
    For example if the test script requires to update the cell of 6th row and 8th column, then how to achieve through openscript API?
    Please kindly let me know.

    Hi,
    Hope this helps!
    Table table;
    String[] rowvalus;
    int targetRow=5,targetColumn=7;
    * Note: Rows and columns are 0-based index.
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("Before change :"+rowvalus[targetColumn]);
    rowvalus[targetColumn]="NewValue";
    utilities.saveCSV(table, "C:\OracleATS\OFT\DataBank\Test.csv", true);
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("After change :"+rowvalus[targetColumn]);
    Note:- Please first take the backup of your CSV file before using this code snippet
    Thanks
    -POPS

  • How do I apply a calculation to row of cells

    Hi.
    I'm using iwork '08 and can't find a way to add a value to row of cells, as per the Calculate menu in Appleworks. I'm trying to update a calendar from the previous year by adding a value of 1 or 2 to the numbers in all the cells so that last year's June 24 becomes this year's June 25. Does Numbers have a way of doing this?

    wonderlips wrote:
    Hi Barry,
    Wow! Your responses to my problem makes a lot more sense when I can see the graphics you sent with them. Not sure what I was looking at, but it didn't contain the screenshots. Below is a representation of what I'm trying to accomplish. (Sorry, but I don't know how to provide a screenshot of the actual doc in this post.)
    Screenshots are taken using shift-command-4, then dragging the crosshair cursor to enclose the part of the screen you want to copy. The file is copied to your desktop as a PNG (portable network graphics) file named Picture 1 (with numbers ranging from 1 to 10), which you can then go to the finder and rename.
    Upload the file to a picture storage site (there are many free ones on the 'net) and store it in an album there. For most sites, clicking on your image (or just moving the pointer over it) will give a list of codes to paste into a message to call that image.
    Use the one labeled HMTL. Copy the code, then paste it into your message.
    You can see an example of the code used by clicking Reply on any message here showing an image, then clicking the quote button ( ” ) to see the text and HTML codes in the message itself. (Click the discard and Cancel button below the message space if you don't actually want to reply to that message.)
    Hope the formatting doesn't completely go away when you get this.
    It does, pretty much. The forum software parses out multiple spaces. Still readable if the reader has an idea what it should look like, and more readable using the technique described above for seeing HTML codes in a message.
    Anyway I can't get the DATE or DAY functions to track properly between cells, because the DAY function converts text into a number,
    DAY() does absolutely nothing with text, except return an error message:
    "DAY requires a date but found a string instead."
    A cell containing a Date and Time value may be formatted to show only the date portion in any of the following forms:
    No matter which of those is visible in the cell, the cell does NOT contain a text string and does NOT contain a number. The cell contains a Date and Time value in which the Date portion is the value for the ninth day of February in the 2006th year of the common era.
    and the DATE function converts a date into a number, and the the two functions don't play nice with each other.
    Actually DATE works in the opposite direction. It constructs a date from three separate numbers.
    The syntax is DATE(year,month,day)
    DATE(2006,2.9) will construct the Date and Time value for February 9, 2006 and set the time value to 0:00:00 (midnight). Depending on the format set for the cell containing the function, the date will display in one of the forms shown in the list above.
    Once the DAY function converts a date into a plain number, it won't reset after 30 and 31. In fact it seems to treat any reference to that cell as a one.
    DAY does return a (plain) number in the range 1-31. If you add 1 to that +number+, you'll get a number in the range 2-32. If you add 1 to the +date+ that DAY extracted that number from, you'll get a number in the range 2-31, or if the new date is in the next month, you'll get the number 1.
    Now that I've seen the graphics that were supposed to come with your posts, it looks like the answer may be a set of reference cells in another table that I can hide from view in the printed form of my chart.
    There's no need for a second table just to get the day numbers in your example. You may need a LOOKUP table to convert the 1s to the shortened name of the current month, though, and that LOOKUP table can be placed on a second table.
    Here's my take on the problem as currently described. Description below.
    Column A contains the starting date in Cell A1. The format is set to display this date including the name of the weekday to ensure the calendar starts on a Monday. (Necessary because the weekday labels in row 2 are entered text, not constructed from the date information being placed on the calendar.)
    A5, and every 4th row after contains a formula that adds 7 to the date in the cell four rows above.
    =$A1+7
    B1 contains a formula that extracts the DAY (of the month) from the date in A1, plus a calculation that allows it to increment the date when filled into the columns to the right.
    =DAY($A1+COLUMN()-2)
    The desire to replace "1" in C1 with "Jun" (the shortened name of the new month) makes the formula a bit more complicated:
    =IF(condition,TRUE: do this,FALSE:do this)
    =IF(DAY($A1+COLUMN()-2)=1,LOOKUP(MONTH($A1+COLUMN()-2),Month Lookup :: $A$1:$A$12,Month Lookup :: $B$1:$B$12),DAY($A1+COLUMN()-2))
    condition: DAY($A1+COLUMN()-2)=1
    as above, the formula extracts the (adjusted) day number from the date in A1, then compares it with the number 1.
    If they're equal the comparison evaluates as TRUE, and the formula does this part:
    LOOKUP(MONTH($A1+COLUMN()-2),Month Lookup :: $A$1:$A$12,Month Lookup :: $B$1:$B$12)
    MONTH() returns the number of the month of the adjusted date in A1, then looks up that value (6) in column A of the table Month Lookup, and returns the corresponding text string ("Jun") from column B of that table.
    If the day number is not equal to 1, the comparison evaluates as FALSE, and the fomula does the last part:
    DAY($A1+COLUMN()-2)
    and returns the day number of the (adjusted) date.
    Constructing the tables:
    Month Lookup table
    Enter 1 in A1 and 2 in A2.
    Select both cells and drag the coltrol down to fill to row 12.
    Enter Jan in B1
    Select B1 and drag the control down to fill ro row 12 (Dec)
    Calendar table
    Enter a starting date in A1.
    Enter
    =IF(DAY($A1+COLUMN()-2)=1,LOOKUP(MONTH($A1+COLUMN()-2),Month Lookup :: $A$1:$A$12,Month Lookup :: $B$1:$B$12),DAY($A1+COLUMN()-2))
    in B1.
    Select B1 and drag the fill control right to fill B1:H1
    (See optional formatting below for adding colour to month names)
    Select B1:H1 and Copy
    Select B5 and Paste.
    Enter
    =A1+7
    in A5.
    Select A2:H5 (as shown in graphic above)
    Drag the control down as many rows as you need.
    Optional formatting
    The red month names on yellow backgrounds are created using Conditional formatting for the seven cells B1:H1 (and similar cells further down the table).
    If you choose to do this, it's best to do so where "See optional formatting..." is placed in the instructions.
    Select B1:L1
    In the Format bar above the tables, set the Text colour to red and the Fill colour to yellow. (This will change the colours in all cells in the row.)
    Open the Inspector and click the Cell Format button.
    Click the Conditional Format checkbox to check it. Click Show Rules.
    From the Choose a Rule popup, choose "Less than or Equal to" and enter 31 in the box that appears.
    Choose Black for the conditional text colour and white for the conditional fill colour.
    Continue with the instructions for Constructing the Tables.
    Regards,
    Barry

  • Custom itemRenderer component based on cell value: error 1009

    I'm working on an item renderer for a dataGrid that has different states depending on the cell and row values.
    The cell value is a toggle (true or null), and sets whether content should be shown in the cell or not
    The row properties determine what is shown when the cell value is true.
    The dataGrid dataProvider is populated based on user id input.
    I created the itemRenderer as a custom actionscript component, closely following this example:
    360Flex Sample: Implementing IDropInListItemRenderer to create a reusable itemRenderer
    However, my component results in Error #1009 (Cannot access a property or method of a null object reference) when a user id is submitted.
    package components
         import mx.containers.VBox;
         import mx.controls.*;     import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
              {super();}
              private var _listData:BaseListData;   
                   private var cellState:String;
                   private var cellIcon:Image;
                   private var imagePath:String;
                   private var imageHeight:int;
                   private var qty:String = data.qtyPerTime;
                   private var typ:String = data.type;
              public function get listData():BaseListData
                   {return _listData;}
              public function set listData(value:BaseListData):void
                   {_listData = value;}
              override public function set data(value:Object):void {
                   super.data = value;
                   if (value != null)
                   //errors on next line: Error #1009: Cannot access a property or method of a null object reference.
                   {cellState = value[DataGridListData(_listData).dataField]}
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState=='true'){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    There are no errors if I don't use an itemRenderer--the cells correctly toggle between "true" and empty when clicked.
    I also tried a simple itemRenderer component that disregards the cell value and shows in image based off row data--this works fine without errors or crashing. But I need to tie it to the cell value!
    I have very limited experience programming, in Flex or any other language. Any help would be appreciated.

    Your assumption that the xml file either loads with "true" or nothing  is right.
    After modifying the code to the following, I don't get the error, but it's still not reading the cell value correctly.
    package components
         import mx.containers.VBox;
         import mx.controls.*;   
         import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
               super();
              private var _listData:BaseListData;   
              private var cellState:Boolean;
              private var cellIcon:Image;
              private var imagePath:String;
              private var imageHeight:int;
              private var qty:String;
              private var typ:String;
               public function get listData():BaseListData
                 return _listData;
              override public function set data(value:Object):void {
                   cellState = false;
                   if (listData && listData is DataGridListData && DataGridListData(listData).dataField != null){
                       super.data = value;
                       if (value[DataGridListData(this.listData).dataField] == "true"){
                           cellState = true;
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState==true){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    - didn't set the value of qty or typ in the variable declarations (error 1009 by this too--I removed this before but wanted to point out in case its useful)
    - added back in the get listData() function so I could use the listData
    - changed the null check
    All cells are still returning cellState = false when some are set to true, even if I comment out [if (value[DataGridListData(this.listData).dataField] == "true")] and just have it look for non-null data. That shouldn't make a difference anyway, but it confirms that all cells are returning null value.
    Swapping out the first if statement in set data with different variables results in the following:
    [if (listData != null)]  all cells return null (cellState=false for all)
    both [if (value != null)] and  [if (DataGridListData != null)]  results in error 1009 on a line following the if, so I assume they return non-null values.
    All rows have data, just not all fields in all rows, so shouldn't listData be non-null?  Could it be that the xml file hasn't fully loaded before the itemRenderer kicks in?
    I also realized  I had removed the item renderer from many of the columns for testing, and since some columns are hidden by default only one column in the view was using the itemRenderer--hence the single alert per row I was worried about earlier.
    Thanks for your help so far.

  • Tables - How to get cell value? How to get/set UI controls properties?

    Hi,
    I want to get a the cell's value of row x and col y.
    The table is not bounded so I cannot use:
    Table1.Items(key).DataSourceRow.DataItem("ColID")
    Another question:
    How to I set the properties of a table column which contains UI elemtents that I create dynamically?
    for exmpale:
    c1 is a TableBodyCell
    tr is a tableRow
    c1 = New TableBodyCell(Table1, tr, 0)
    c1.TableCellContent = New InputField
    tr.Cells.Add(c1)
    How do I set/get the properties of the InputField?
    Thanks,
    Omri

    Thanks Reshef,
    My Table's scheme:
    Column 0 - TextView
    Column 1 - InputField
    I was able to get a cell value of type TextView by using what you suggested:
    Write(CType(Table1.Items(0).Cells(0).TableCellContent,TextView).Text)
    However, when I tried to do the exact thing to InputField I didn't get any value (nor error)
    Write(CType(Table1.Items(0).Cells(1).TableCellContent, InputField).Value)
    I fill the Input Field and then push "Execute" button which supposed to write the value.
    About my second question:
    By using the cast (CType) I can access the properties I need (like Width) so it kind of solve my problem.
    for example:
    CType(Table1.Items(1).Cells(1).TableCellContent, InputField).Width = "15px"

  • Permanently set Repeat cell values on table view obiee11g

    Hi,
    By default Analysis presentation Column comes with "Column Value Suppression" but we need to switch "Column Value Suppression" to "Repeat cell values" from source xml reference file
    Note:don't want to do it via analysis table/column properties(its manual work) ..just looking to change permanently by changing xml
    Thanks
    Deva

    Hi,
    What is that datatypeformats.xml ? couldn't find out. once again will explain my requirement
    Creating new analysis(Table/Pivot table view) and applying format as Repeat Cell by changing Table/Pivot Properties to set Enable alternating row "green bar" styling Repeat cell values on table/pivot view (instead of doing manual way)
    Refer the below image --> i just want to avoid manual enabling below Repeat cell option for entire table/pivot view option
    http://i.imgur.com/122wp.jpg?1
    Thanks
    Deva
    Edited by: Devarasu on Nov 26, 2012 5:06 PM

  • Setting Table Cell Renderer for a row or cell

    I need to make a JTable that has the following formats:
    Row 1 = number with no decimals and columns
    Row 2 = number with no decimals and columns
    Row 3 = percent with 4 decimals
    I can use a table cell renderer to set each COLUMN as one or the other formats like this:
    NumDispRenderer ndr = new NumDispRenderer();
    for(int i = 1;i<dates.size();i++) {
    table.getColumnModel().getColumn(i).setCellRenderer(ndr);
    Where NumDispRenderer is a class as follows:
    public class NumDispRenderer extends DefaultTableCellRenderer {
    public Component getTableCellRendererComponent (JTable table, Object value,boolean isSelected, boolean isFocused, int row, int column) {
    Component component = super.getTableCellRendererComponent (table,value,isSelected,isFocused,row,column);
    if (value != null && value instanceof Double) {
    DecimalFormat df = new DecimalFormat("###,###");
    String output = df.format(value);
    ((JLabel)component).setText(output);
    ((JLabel)component).setHorizontalAlignment(JLabel.RIGHT);
    } else {
    ((JLabel)component).setText(value == null ? "" : value.toString());
    return component;
    This is fine for the first two rows, but the third row (which is also an instance of Double) I would like to format differently.
    The tutorial and other postings have not given a solution to this problem. Any suggestions would be very appreciated.

    Hi,
    the method getTableCellRendererComponent() of your renderer gets the row as a parameter. So just create the label depending on that value. For 0<=row<=1 you create the label as is, and for row=2 you create another label with the Double formatted as you wish.
    Andre

Maybe you are looking for

  • Calendar entries made on Iphone do not sync to Icloud

    Why do my appointment entries made in Icloud calendar sync to phone but, appointment entries made on phone do not sync to I coud calendar.

  • Advantage of NAT IP Pool for PAT

    Hi support community, would there be any benefits from using a small pool of public IPs (outside global addresses) to perform PAT instead of using a single IP address that is nomally associated with outside interface? We have enough public IPs where

  • Print without print options window popping up?

    i have a class that sends a Component to the printer. a window always pops up to let you choosing printing options. is there a way to just send a job to the printer using the defaults so that the user doesnt have to hit ok every time? thanks...

  • Firefox freezes frequently when saving a web page.

    Hello. Around 80% of chances when I'm saving a web page, Firefox freezes and nothing works (such as close tabs, reload the page, etc), what I have to do is open the Task Manager and end the process of FF then restart it. I have this problem for a lon

  • Create report from 2 databases where one DB is a subset of the other

    I am pulling data from two databases (DB1 and DB2).  DB1 contains all records and DB2 contains only a subset.  The databases hold different information but each has a common primary key to link them. I want to create a report that shows all records.