Changing Subtotal row color
Hi Experts,
how can i change the color of sutotals/totals row in a BEx report from default YELLOW to any other color as per clients choice.
thanks in advance
hi
check this thread:
Re: Color format changes
cheers
Sunil
Similar Messages
-
Changing JTable Row Color OnMouseOver
Hello everybody,
is it possible to change JTable Row Color when Mouse passes over it ??
THanks!Yes...
You have to override the table cell renderer and set the color of the rows based on flag.
The flag can be turned on/off in a mouse motion listener of the table. -
Change the row colors based on column values in MOSS 2007.
Hi Team,
I am using MOSS 2007 environment. In that I am having one SharePoint list. In that list based on column values rows colors need to change.
Kindly help me anyone on this.
Thanks,
AshokHi Ashok,
Please follow the below link:
http://www.contentmaster.com/sharepoint-2010/conditional-formatting-of-list-views-for-sharepoint-2010-changing-the-font-colour/
http://sharepoint.stackexchange.com/questions/7478/highlight-row-color-based-on-field-values-in-sharepoint-2010-list-view
Best Regards,
Brij K -
How to chang the row's color in the Jtable?
I have a table and many rows,I want chang the rows color,like row one's color is red,row tow's color is write,row three's color is green.How can do it? And if i want chang row 3,coloum 2's color.How can do it?
thanks.hi,
I use jdbtable to view data,I want them to chang row color when some cells equal the value.But interface getTableCellRendererComponent not run.I don't know why!
jdbtable is extend jtable ,it made in borland jbuilder.
//1 class
package errorreport;
import java.awt.Component;
import java.awt.Color;
import javax.swing.table.DefaultTableCellRenderer;
import com.borland.dbswing.*;
public class rowcolor extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent
(JdbTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column)
Component cell = super.getTableCellRendererComponent
(table, value, isSelected, hasFocus, row, column);
int iColcount = 0;
iColcount = table.getColumnCount();
if( value instanceof String )
String strAlmlev = (String)value;
if(strAlmlev.trim().equals("C1"))
cell.setBackground( Color.red );
// You can also customize the Font and Foreground this way
// cell.setForeground();
// cell.setFont();
else
if(strAlmlev.trim().equals("C2"))
cell.setBackground( Color.orange );
else
if(strAlmlev.trim().equals("C3"))
cell.setBackground( Color.yellow );
else
if(strAlmlev.trim().equals("ERR"))
cell.setBackground( Color.green );
return cell;
//2 class
JdbTable jdbTable2 = new JdbTable();
TableCellRenderer renderer = new rowcolor();
try
jdbTable2.setDefaultRenderer( Class.forName( "java.lang.String" ), renderer );
catch( ClassNotFoundException ex )
System.exit( 0 );
thanks -
Dynamically changing row color in an ADF table?
Hi,
I am using Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. Can anyone please let me know the code for dynamically changing the row color of an ADF table?
Thanks,
Vikwell you can use EL on af:column inlineStyle property to change the color on condition
e.g
inlineStyle='#{(row.SelectedRow)?"background-color: Silver":""};a example can be found here it is changing color based on Checkbox selection http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html -
Hello Everyone,
I'm trying in the configure properties of a table change the row colors to alternating, but it has no effect.
It always remains the same formating, i.e., every row with the same blue color.
I only can set it to alternating if the table is marked in the properties as editable (Editing condition = true). It doesn't make any sense! I do not want the user to change the cells of the table, but still want to use alternating colors, and it is not possible.
I'm using Visual Composer 7.01 with SP5
Does anyone have any idea?
Tanks,
Diogo Ferreira.Hi,
For messages about VC 7.0 version (this includes 7.01 and 7.02) please refer to the [VC 7.0 forum|SAP NetWeaver Visual Composer;.
Best regards,
Tal. -
How can I change the row colors in an updated list or pie chart view to use a certain color based on the value it is reporting?
Yes this is possible. You can create a calculation that is an HTML code, within the command you can have an If statement to set the color of the field based on its value. Take a look at the Technote for Custom HTML Reports and it will give you an Idea. http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_CustomHTMLReport.pdf
-
How to change the default color of the selected row
hi all,
I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
thanks and regards,
rpkThe chart colors are being referred to *'palette.cxml'* file in these directories
BI_HOME\web\app\res\s_oracle10\chartsupport
BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
you can change to your custom colors.
Restart OC4J and PS to make the new ones work..
Regards,
Raghu -
Report row color change based on condition
I have follow this forum steps Re: Color Row In Report
Column Template 1
<td #ALIGNMENT# class="t1data" style="background-color:#ADD8E6;">#COLUMN_VALUE#</td>
PL/SQL expression condition
'#2#' = 'BOOKED'
Column Template 2
<td #ALIGNMENT# class="t2data" style="background-color:#FFE87C;">#COLUMN_VALUE#</td>
PL/SQL expression condition
'#2#' = 'ENTERED'
http://img29.imageshack.us/img29/2792/apexcolor.png
This does color change but for some rows the colors are highlighted wrong and when i mouse over the rows , it changes to wrong color.Hi,
t1Data and t2Data sound like standard theme css class names.
In my example, the colouring is done by the style attribute on the TD tag. For "normal" rows:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>for highlighted rows:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data" style="background-color:red;">#COLUMN_VALUE#</td>Have you defined "t1Data" and "t2Data" in STYLE tags on your page?
Andy -
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 change the semantic color of entire rows in a table.
Hi, in the past I already managed to change the semantic color of a cell by a condition (for example all the cells with negative number -> I set negative semantic color)
My question is how can I change the semantic color of the entire row where this cell belong, and not only the cell. Im using NW2004.
BTW, Im not a java programmer, neither a Webdynpro expert, just an ABAP Programmer. So try to be very explicit, Thx.Rodrigo,
You can just bind correspondign property of every cell editor (TextView) of every column to the very same context attribute. Next, when you change attribute value for certain elemnt, the whole row (every cell editor in row) will get same value.
Valery Silaev
SaM Solutions
http://www.sam-solutions.net -
How to change the background color of a single row
Hi OTN,
I am using JDeveloper 11.1.1.2 with ADF faces in view layer.My issue is How to change the background color of a single row in af:table ?.How to highlight ADF table row based on column value?
Found by searching -
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 -
How do I change the background color of a row in a table indicator?
Hello,
How do I change the background color of a row in a table indicator? I know how to change the background color in a active cell, but that is not what I want. My first intent is to make the background color of the first row a unique color, such as green, just to highlight the top row of the table.
Regards,
Kaspar
Regards,
KasparI have done this before by using a for loop to change the active cell of a row in order to give the appearance that the whole row is turning the color at once.
CLA, CLED, CTD,CPI, LabVIEW Champion
Platinum Alliance Partner
Senior Engineer
Using LV 2013, 2012
Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved. -
How can I change the background color of odd/even rows in a panelCollection
Hi everyone.
I'm using a panelCollection and I need to change the backgroung color for odd/even rows in the table,
how can I do this, using a stylesheet, is there a special selector or property for this?
globalResultCollection (UIPanelCollection object) , is a collection of UITable elements, and it's working fine.
I just want to change the defaul background color for rows.
Thanks
<af:panelCollection id="GLOBAL_RESULT_COLLECTION"
binding="#{admin.view.globalResultCollection}"
styleClass="globalResultCollectionRegion"
clientComponent="true">
<f:facet name="menus">
<af:menu id="GLOBAL_OPERATION_MENU"
binding="#{admin.view.globalOperationMenu}" />
</f:facet>
<f:facet name="toolbar">
<af:toolbar inlineStyle="width:100%"
binding="#{admin.view.globalOperationToolbar}"
id="OPERATION_TOOLBAR"/>
</f:facet>
</af:panelCollection>Hi,
use this:
af|table::data-row af|column::data-cell { background-color: #CCCCFF; }
af|table::data-row af|column::banded-data-cell { background-color: #FFCCCC; }
Regards,
s o v i e t
Maybe you are looking for
-
ODBC For Oracle 8.1.5
I have downloaded the above driver and the univeral installer. Installed them and got the "Installation Successful" Message. When I go to add new data sources and select Oracle ODBC Driver (Version 8.01.57.00) I get an error "Setup Routines for the O
-
Queries with variable input giving error
Hello all, I have a query which asks for fiscal year and posting period at the start of query run. But when I run the query in Bex analyzer, it gives me this error all the time. "Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION System erro
-
Getting Smooth Text with Boris Title Crawl (Scroll)
Hi, using FCP 5 (Studio) with Boris Title Crawl generator. It seems to work pretty well, does what it should, renders relatively fast, all that. The only problem is the upward scrolling motion is a little jumpy. Just wondering what things I should be
-
Bookmarks imported from IE has folders but are all empty (win7 64 bit)
bookmarks imported from IE shows folders, but all folders are empty and there are no bookmarks at all. IE8.0.7600 to FFox3.6.3 on win7 64bit
-
Should there be a special access granted to access SOURCEFIRE under Firewalling?
Should there be a special access granted to access SOURCEFIRE under Firewalling?