Sort Rows by Color?

I have color coded some of the rows for a project I'm working on and would love to sort all the 'colored' rows together. Is there a way to sort by the color that I've chosen to fill each row with?
When I had only two colors I was using a workaround. I added a check-box column and had one color = a check mark. That allowed me to sort the checkbox column. Now I have four colors and this doesn't work any more.
Any ideas?

Quick & dirty solution:
Add a column with the header marked 'color'
Then use numeric or text entries: Red, Blue, Green, Black, 1, 2, 3, 4 ... a, b, c, d, or whatever for your color codes in that column.
Then sort by the 'color' column.
Now mark the 'color' column as hidden.

Similar Messages

  • Is it possible to sort rows by font color in Numbers ?

    Is it possible to sort rows by font color in Numbers ?

    CC,
    You probably had something in mind when you applied the colors to the text. It's always best to record the conditions directly rather than to indicate them indirectly by by use of color.
    You can use Conditional Formatting to do some color coding based on the condition. You might even find that it's easier to let the conditional format tool than to assign the colors manually.
    Jerry

  • Sort rows by fill color?

    Is it possible in Numbers to sort rows based on the row fill color? There are only 2 colors the rows have as background (fill), and it would save time to sort based on the highlighted row. Any ideas?
    Thank you-

    I agree with jerrold.
    I will certainly not ask Apple for such a feature.
    Here is a script which may give you an efficient response.
    property columnOffset : 2
    tell application "Numbers"
    activate
    set {rName, tName, sName, dName} to my getSelection()
    if (character 2 of rName) as text > "9" then
    set columnLetter to text 1 thru 2 of rName
    else
    set columnLetter to character 1 of rName
    end if
    set twoNames to my decoupe(rName, ":")
    set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
    set columnToSort to colNum1 + columnOffset
    tell document dName to tell sheet sName to tell table tName
    set myColor to background color of (get properties of range rName)
    set nbRows to count rows
    repeat with r from 1 to 14 --nbRows
    set val to background color of (get properties of range (columnLetter & r & ":" & columnLetter & r))
    set val to (val is myColor)
    set value of cell r of column columnToSort to val
    end repeat
    end tell
    end tell
    --=====
    on getSelection()
    local mySelectedRanges, sheetRanges, thisRange, _, myRange, myTable, mySheet, myDoc, mySelection
    tell application "Numbers"
    activate
    tell document 1
    set mySelectedRanges to selection range of every table of every sheet
    repeat with sheetRanges in mySelectedRanges
    repeat with thisRange in sheetRanges
    if contents of thisRange is not missing value then
    try
    --return thisRange --poorly formed result
    thisRange as text
    on error errMsg number errNum
    set {_, myRange, _, myTable, _, mySheet, _, myDoc} to my decoupe(errMsg, quote)
    --set mySelection to (a reference to (range rn of table tn of sheet sn))
    return {myRange, myTable, mySheet, myDoc}
    end try
    end if -- contents…
    end repeat -- thisRange
    end repeat -- sheetRanges
    end tell -- document 1
    end tell -- application
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on decipher(n)
    local letters, colNum, rowNum
    set letters to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    if (character 2 of n) as text > "9" then
    set colNum to (offset of (character 1 of n) in letters) * 64 + (offset of (character 2 of n) in letters)
    set rowNum to (text 3 thru -1 of n) as integer
    else
    set colNum to offset of (character 1 of n) in letters
    set rowNum to (text 2 thru -1 of n) as integer
    end if
    return {colNum, rowNum}
    end decipher
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    Select a cell with the color to use in the sort.
    Run the script.
    It will fill the column whose offset from the selected one is defined by the property 'columnOffset'
    If the background of the cell in the source column is the searched one the value will be 1
    if the background is not this one, the value will be 0.
    So it will be easy to use a condition.
    Yvan KOENIG (from FRANCE mardi 10 mars 2009 20:39:44)

  • Sort and fill color SSRS

    I have one report i want to sort the year as well as month change the background color row wise.
    like
    2011    january          red
                february            red
              march             green
    2010
               january            red
               february             green
               march              pink
    According to the color column text color name   the row  background color has to be change.

    Hi,
    Once you rendered the data in the Tablix. You can do Group by Year and Sort by year & Month. Hope you have done like that only as per the screenshot i understood. Since the month is in characters if you sort the month it will come like this only. So
    we can write a Case statement to identify the months in number (if January then assign 1, Feb then assign 2 like that) and have this number in a separate column as month_order. While sortiing give "Sort by Year,month_order". This will satisfies your sorting
    issue i guess.
    And color the row u did't give in detail so i understood like alternative row. U can use the below expression in the row background color property "=IIf(RowNumber(Nothing)
    Mod 2 = 0,
    "Silver",
    "Transparent")"
    Thanks & Regards,
    Sridhar V
    Dont forgot to "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful

  • Change row's color in report painter

    Hi all!!!
    anybody knows how change row's color in report painter,
    for example
    number   name        |  money          
       7020   payments1 | 100.00   
       7021   payments2 | 200.00
        summary            |  300.00
    change color of row  "7020   payments1" and "7020   payments1"
    Regards!!!

    Hi,
    For it, first place the cursor on the row and choose Formatting > Row. In the next dialog box, select a color (for totals, subtotals, inserted rows, or for emphasis). The system assigns a color based on the selection you make here.
    Regards,
    SDNer

  • WorkOrderList TileView Row & Selected Row Background Color Change

    Hi,
         can we change the background color of WorkorderList TileView Row & Selected Row Background color ?. Actually i am trying to change the color of both in WorkOrderList but it not reflecting any color on my Agentry client. I used a style on Tile List View Data/Style.
    but these applied style on Rows & Selected Rows are not working in Agentry client.
    if any other alternate solution exist in Agentry, please guide me.
    i am using following...
      sap mobile platform-2.3.3
    Thanks & Regard
    Manish Kumar
    Tags edited by: Michael Appleby

    Hi Jason
          Yes using Image we can achieve that goal but i want to use a background color instead of Image background. Finally I used a background color on label and set the that label field on Screen. And It's showing the background color on WorkOrderList Row & Selected Row that what i wanted. But on both Row & Selected TileView Screen showing white outline that i don't want and also i could not remove the default Selected Blue Background Color.
         Please guide me how to remove white outline and default Blue Selected Background color.
    Thanks & Regard
    Manish Kumar

  • Displaying Alternate row as colored in Cross tab

    Hi,
    I have a report where I need to display alternate rows as colored.
    There is some data in detail section followed by a cross tab in the report header section.
    While I am able to display alternate rows as colored in Detail secction for displaying alternate colored rows in Cross tab data I need some help.
    Data in cross tab is like this
                  history geography
    Tammy   90          60
    Sid         80          50
    Julia       70        40
    In cross tab for displaying alternate colored rows ie for alternate student names  I am using two formulas
    - for displaying row values I am using this one
    whileprintingrecords;
    numbervar d;
    d := iif(d=100,255,100);
    color(255,255,d);
    For displaying alternate colored inner cells ie marks  I am using this formula
    whileprintingrecords;
    numbervar c;
    c := iif(c =255,100,255);
    color(255,255,c)
    I got these formulas after doing Googling
    My cross tab is present in report footer and in the generated report it comes separeated in two pages.
    In the first page data for Tammy and Sid is displayed while Julia is displayed on next page.
    Now the Tammy is coming as yellow colored and as expected Sid is coming as white colored. However Julia which is on next page is coming as white , but logically it should have come as yellow. On the other hand my column data ie marks column is coming fine. Data for tammy and sid is coming as alternately colored and data is Julia on the next page is coming as yellow(as data for Sid is in white)
    I am not able to understand why this is happening and what is the correct way to do alternate row coloring in cross tabs
    Edited by: thunderball10 on Aug 26, 2010 11:57 AM
    Edited by: thunderball10 on Aug 26, 2010 12:00 PM

    Where is your variable c being reset.
    If in page header or group header and you have repaet group header on new page then c will be reset on each page.
    If In groupheader try adding this to reset formula
    if not inrepeatedgroupheader then
    Ian

  • JTable - row focus color

    I wrote a program which will change the color of each row.
    odd row background color will be white
    even row background color will be gray.
    My doubt is?
    if i move the mouse on the any row, that row should have a different background color (dark of row background)

    I tried with DefaultTableCellRenderer, but it is not
    workingIs this what you want?
    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.TableCellRenderer;
    public class RowColor extends JFrame {
        public RowColor() {
            Object[][] data =
                {"Row 1", "Row 1"},
                {"Row 2", "Row 2"},
                {"Row 3", "Row 3"},
                {"Row 4", "Row 4"}
            Object[] columnNames = {"Column 1","Column 2"};
            JTable table = new JTable(data, columnNames) {
                public TableCellRenderer getCellRenderer(int row, int column){
                    DefaultTableCellRenderer c = (DefaultTableCellRenderer)super.getCellRenderer(row, column);
                    if (row % 2 == 0)
                        c.setBackground(Color.GREEN);
                    else
                        c.setBackground(Color.YELLOW);
                    return c;
            JScrollPane scrollPane = new JScrollPane( table );
            getContentPane().add( scrollPane );
        public static void main(String[] args) {
            RowColor frame = new RowColor();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }

  • AdvancedDataGrid Row background color

    Hope someone can help, I wish to highlight an entire row or rows that match a value. I assumed the stylefunction would get me there but I have not found the style refering to the row background color.
    Any help please.
    Thank You

    The solution I found was to extend the data grid class, add override to the draw background and add a rowcolorfunction. When using item renderers you must use the style function with the alternatingItemColors so the renderer gets the color correct and not opaque.
    Thanks looking saisri2k2.

  • Sorting rows by choosen column.

    What kind of Array(Map, or any other data structure) should I use, if i want sort all rows by values in j-th column.
    Suppose i need to store data like this:
    Name | Surname | Telephone
    ---------| ---------------|--------------
    Dawid| Olaf | 3422353
    Jack | Ugly | 7872347
    Mike | Opis | 38483848
    And now i want sort all rows by Surname.
    Is there any covenient data structure to make such things ?

    Why you asking for ?
    I'm simply not familiarize with data structures in java and i thought that there is data structure in java like array, with possibility of sorting rows by choosen column.
    I think the only way to do that is use sortAllRowsBy(DefaultTableModel model, int colIndex, boolean ascending).

  • MS Query...cannot write sorted rows error

    I have an MS Query report crated and it was working well until i tried to remove a Criteria Filter within the query. I get an error "Cannot Write Sorted Row". If I acknowledge the error, the change to the criteria is not saved and it reverts to
    the original setting. I had several columns sorted, of which i deleted the SQL code for sort thinking that may help. I also tried to delete the Criteria Filter via the wizard and directly in SQL but that did not help.
    Any suggestions of what may be the issue?

    This is a Power Query forum and so it's unlikely you'll find MS Query experts here. That being said, did you try using Power Query for your scenario?

  • Sort rows in JTable except the last row

    Hi All,
    I have a JTable, which contains columns with numbers. The last row contains column sums.
    I want to be able to sort rows, but the last row with sums must remain motionless.
    Does anyone know the solution of this problem?
    Thanks in advance.

    These two posts are my example. It works pretty good but there is one significant niggle - when moving a column the 'total' table does not move smoothly but it does move. I look forward to 'camickr' reducing this to about 1 line.
    Part A.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Font;
    import java.text.DecimalFormat;
    import java.util.Comparator;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableColumnModel;
    import javax.swing.table.TableModel;
    import javax.swing.table.TableRowSorter;
    public class Sabre20090331
        static private class TotalizingTableComponent extends JScrollPane
            private TotalizingTableComponent(final TableModel tableModel)
                final SecondaryTableModel secondaryTableModel = new SecondaryTableModel(tableModel);
                final JTable secondaryTable = new JTable(secondaryTableModel);
                for (int i = 1; i < secondaryTableModel.getColumnCount(); i++)
                    secondaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                secondaryTable.getColumnModel().getColumn(0).setCellRenderer(new TitleCellRenderer());
                final TableColumnModel secondaryTableColumnModel = secondaryTable.getColumnModel();
                secondaryTable.setRowSelectionAllowed(false);
                final JTable primaryTable = new JTable(tableModel);
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    primaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                final TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
                final DoubleComparator doubleComparator = new DoubleComparator();
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    sorter.setComparator(i, doubleComparator);
                primaryTable.setRowSorter(sorter);
                primaryTable.getColumnModel().addColumnModelListener(new TableColumnModelListener()
                    @Override
                    public void columnAdded(TableColumnModelEvent e)
                        // System.out.println("columnAdded()" + e);
                    @Override
                    public void columnRemoved(TableColumnModelEvent e)
                        // System.out.println("columnRemoved()" + e);
                    @Override
                    public void columnMoved(TableColumnModelEvent e)
                        //System.out.println("columnMoved()" + e);
                        secondaryTableColumnModel.moveColumn(e.getFromIndex(), e.getToIndex());
                    @Override
                    public void columnMarginChanged(ChangeEvent e)
                        //System.out.println("columnMarginChanged()" + e);
                        final TableColumnModel cm = (TableColumnModel) e.getSource();
                        for (int i = 0; i < cm.getColumnCount(); i++)
                            secondaryTableColumnModel.getColumn(i).setPreferredWidth(cm.getColumn(i).getWidth());
                    @Override
                    public void columnSelectionChanged(ListSelectionEvent e)
                        //System.out.println("columnSelectionChanged()" + e);
                final JTableHeader primaryHeader = primaryTable.getTableHeader();
                JPanel inner = new JPanel(new BorderLayout());
                this.setColumnHeaderView(primaryHeader);
                this.setViewportView(inner);
                inner.add(primaryTable, BorderLayout.NORTH);
                inner.add(secondaryTable, BorderLayout.CENTER);
            public static void main(String[] args)
                final JFrame frame = new JFrame("Totalizing JTable Example");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                final TableModel tableModel = new PrimaryTableModel();
                frame.setContentPane(new TotalizingTableComponent(tableModel));
                frame.pack();
                frame.setVisible(true);
    }Edited by: sabre150 on Apr 1, 2009 9:21 AM
    Changed the layout of the inner panel so that the secondary table is now in the CENTER. This stops the secondary table becoming detached from the primary when one expands the frame beyond the prefferred size.

  • IDCS3 - Sort Rows in a Table

    Hello...is it possible to sort rows of text alphabetically in a table created in ID? Can't find any reference to that in Help.
    Thanks!
    Lisa

    Sounds like your easiest solution is to use the ORDER BY clause in your SQL statement:
    http://www.w3schools.com/sql/sql_orderby.asp
    If that won't do the trick, this might help:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    (see Sorting and Otherwise Manipulating Data toward the bottom)

  • Row background color in dataTable control based on criteria

    It is relatively straightforward to give a pattern of color to rows in a dataTable control, for instance to alternate colors from white to gray.
    However, I have not yet figured how the row background color could be decided based on data fields associated with each row. For instance, I would like to set the row background color based on the value of a boolean attribute associated with the row, e.g. white if value is false and gray if it is true.
    Is there an easy way to do this?
    Martin

    of the text, but not the whole cell. I need to find a
    way to change the span at the row level (on the <tr>
    tag). ANy ways to do this?
    MartinThis is a question of how to let the renderer adjust its behaviour depending on the current state of the model. My renderer changes the background for the selected row by changing the style class:
            writer.startElement("tr", table);
              if (table.getRowSelector())
                   if (table.isAtSelectedRow())
                        writer.writeAttribute("class", "selectedRow", null);
    etc.(of course, to be able to do this you must write your own renderer)
    erik

  • Is it possible to give an added row a Color.

    Hello I read data of a txtfile and than place the data in a jtable.
    I know how to give a selected row an other color but my question is:
    Is it possible to give an added row a Color.
    I make the new row this way
    moddellist.addRow(new Object[]{data,""});
    Now I want this added row red is this possible.
    I don't know what the rowIndex or Cell number is.

    The colour of a cell in a JTable is assigned by a TableCellRenderer. If you look at how that works, all it knows is the object in the cell, the table, the row and column number, and whether the cell is selected or focussed. It doesn't care when things happened.
    So if you want your TableCellRenderer to colour your cells based on something that isn't in that list, then you have to modify the design of your object, the one in the cell, so that it contains information the cell renderer can use to decide what colour to render it.
    Based on your description I can't say much more than that, because it's hardly a complete description of how the colour scheme is supposed to work.
    And by the way the people in the Swing forum are better at answering Swing questions.

Maybe you are looking for

  • Cheque lot not found

    Dear All, While using FBZ5, it is giving error that "lot not found" error number is FIBL547, I check cheque lot also but everything is maintain properly, even I tried to post other document with same cheque lot, same company code, in that case it is

  • SSIS Expressions Problem

    Hi All, Please help on the SSIS issue. i have a package.It contains Foreach loop container,Inside foreach loop container,I have one Dataflow task(Inside dataflow task,i am using Oledb source(table),I am populating  Data into Flat file)with flat file

  • Connection to Essbase

    Hi, we sucessfully created rpd file with connection pool to Essbase server, but we get error by creating requests Odbc driver returned an error (SQLExecDirectW). Error Details Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000. Code: 10058. [NQODBC

  • Calc script logic help needed urgently

    Hello Gurus, I am desiging a calc for Fringe Benefits account. Longterm disability is calculated by multiplying cost pr employee  per month ( constant hard coded number) with the % of Net Headcount % of NetHEadcount is NetHeadCount(at lowest dept lev

  • Playing Imported Audio Books - tracks won't play in order - why?

    I import a lot of Audio Book CDs into my iPod Touch for convenience. The problem is that although the tracks import in order, are correctly named and play in order from iTunes on the PC they almost never play in order on my IPod Touch, Ipod Classic o