Setting background color of a cell
Hi guys,
Iam writing to screen as follows.
daTA str TYPE string.
LOOP AT gt_ditab.
CLEAR str.
WRITE: /1(1)'|'
, 2(12) gt_ditab-vbeln LEFT-JUSTIFIED,14(1)'|'
, 15(12) gt_ditab-bstnk LEFT-JUSTIFIED, 27(1)'|'.
IF ( gt_ditab-verbrauchnr EQ space OR gt_ditab-verbrauchnr IS INITIAL ).
str = 'N'.
WRITE: 28(12) str COLOR 6 , 40(1)'|'.
ELSE.
WRITE: 28(12) gt_ditab-verbrauchnr LEFT-JUSTIFIED , 40(1)'|'.
ENDIF.
WRITE: 28(12) gt_ditab-verbrauchnr LEFT-JUSTIFIED , 40(1)'|',
/1(40) sy-uline.
ENDLOOP.
if "gt_ditab-verbrauchnr" is empty ,I want the background color of this cell(Only this cell) set to light red. I tried something as above.(See bold code)
But the cell colour is not changing.What am I doing wrong?
Thanks
K
i will give you a sample code.. go though this...
data flag type vbak-vbeln.
DATA str TYPE string.
DATA : ABS type string.
DATA : frac type i.
do 10 times.
WRITE: /1(1)'|'
, 2(12) '123' LEFT-JUSTIFIED,14(1)'|'
, 15(12) 'def' LEFT-JUSTIFIED, 27(1)'|'.
abs = sy-index / 2 .
frac = frac( abs ).
if frac is INITIAL.
flag = '000001234'.
else.
clear flag.
endif.
IF flag is INITIAL..
str = 'N'.
WRITE: 28(12) str COLOR 6 , 40(1)'|'.
clear str.
ELSE.
WRITE: 28(12) flag LEFT-JUSTIFIED , 40(1)'|'.
ENDIF.
WRITE /1(40) sy-uline.
ENDDO.
check and get back..
Similar Messages
-
Problem to set background color for configTable cell
Hi All,
I've a configTable displays some status fields, and I need to set yellow color when the status is in processing and green when finished and red when cancelled. I've searched the forum and decided to use iterator with method RENDER_CELL_START. Here are the steps that I've done.
Step 1: wrote a new class ZCL_ACTSTAT_ITERATOR implements interface IF_HTMLB_TABLEVIEW_ITERATOR.
this class has a private attribute ORDERS containing the search result internal table data, in the CONSTRUCTOR method I pass the search result to the attribute using the statement ME->ORDERS = ORDERS. Then in the method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START I check the p_column_key for the status fields and then get the status value and set p_style accordingly using the following statement:
CASE p_column_key.
WHEN 'PREPAY_STATUS' OR 'DELVPLN_STATUS' OR 'DESIGN_STATUS'.
READ TABLE me->orders INTO ls_order INDEX p_row_index.
IF sy-subrc NE 0.
EXIT.
ENDIF.
ASSIGN COMPONENT p_column_key OF STRUCTURE ls_order TO <col>.
IF sy-subrc = 0.
wf_text = <col>.
ENDIF.
IF wf_text = '00' OR wf_text = 'Initial'.
* concatenate '<font color=""red"">'
* WF_TEXT '</font>' into html_str.
* create object html_bee.
* html_bee->add( html = html_str ).
* p_replacement_bee = html_bee. "not work either
p_style = 'celldesign:STANDARD'.
ELSEIF wf_text = '10' OR wf_text = 'InProcessing'.
p_style = 'celldesign:GOODVALUE_MEDIUM'.
ELSEIF wf_text = '20' OR wf_text = 'Finished'.
p_style = 'celldesign:GOODVALUE_LIGHT'.
* p_style = 'background-color:#92D050'.
ENDIF.
ENDCASE.
Step 2: In the component controller ZL_ZACT_MYO_ORDERS_IMPL, create a public attribute GV_ITERATOR type ref to the class created in step 1 (ZCL_ACTSTAT_ITERATOR), then in the controller's DO_PREPARE_OUTPUT method, get the combined context data and convert them into internal table LT_ORDERS, then create the iterator GV_ITERATOR passing LT_ORDERS, after this step, the result data can be transfered into iterator class and then be used in the RENDER_CELL_START method.
The DO_PREPARE_OUTPUT method is like bellow:
lr_pro ?= me->typed_context->order->collection_wrapper->get_first( ).
WHILE lr_pro is BOUND.
lr_pro->get_properties( IMPORTING es_attributes = ls_order ).
if ls_order is not initial.
append ls_order to lt_order.
endif.
lr_pro ?= me->typed_context->order->collection_wrapper->GET_next( ).
ENDWHILE.
CREATE OBJECT lc_iterator
EXPORTING
orders = lt_order.
me->GV_iterator = lc_iterator.
Step 3: in the .htm page, point iterator to controller's iterator
<chtmlb:configTable id = "Table1"
table = "//ORDER/Table"
iterator = "<%= controller->GV_ITERATOR %>"
/>
Step 4: in the GET method of status attributes in context node ORDER, do the translation to change the status code into status description
METHOD GET_PREPAY_STATUS
DATA: OLD_VALUE TYPE ZACT_STATU,
LS_STATUS TYPE ZACT_STATUS_S.
OLD_VALUE = VALUE.
READ TABLE GT_STATUS INTO LS_STATUS WITH KEY STATUS = OLD_VALUE.
"Get status description from field domain definition
IF SY-SUBRC = 0.
VALUE = LS_STATUS-NAME. "Show status description
ENDIF.
ENDMETHOD.
I thought I could see the status fields change their styles for different status code. But it still refuse to work, although I can debug to see that p_style really set as I expect, so I think there must have something wrong after RENDER_CELL_START, but what is it?
Could anyone please help me sort it out or point out what's missing there or guide me the correct steps? Any post is greatly appreciated.
Thank you!
Jeff
Edited by: liu jinghui on Feb 9, 2012 6:37 PMHi, Jeff.
Just don't want to cross post the same answer all over the forum. So I gave some inputs on the topic in this message: http://forums.sdn.sap.com/thread.jspa?messageID=11127647�
Hope this will help you. -
How to change the background color of a cell in datagrid using flex3
i want to change the background color of a cell.....how can i achieve this.....and also i want to know how a spacing cane be done between cells in a datagrid...plzzz help me???
The only way I can see to do this is to use an item renderer for your cells. This is really scruffy and would need tyding up, and maybe with a little more time could do better or someone else may have an idea but none the less this works.
Define a custom component as below;
This has logic to see what the value of the data is proveided by the dataprovider for the row, and if it matches the conditions in this case is equal to 5 sets the background color.
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="88" height="26" dataChange="doColor()" borderColor="#000000" borderStyle="solid"
backgroundAlpha="1">
<mx:Script>
<![CDATA[
private function doColor():void {
if (data.value == 5) {
setStyle('backgroundColor', 0xcccccc);
} else {
setStyle('backgroundColor', 0xffffff);
]]>
</mx:Script>
</mx:Canvas>
Now just apply the item renderer in the datagrid and that will do it.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var ac:ArrayCollection = new ArrayCollection([
{value : 1},
{value : 2},
{value : 3},
{value : 4},
{value : 5},
{value : 6},
{value : 7},
{value : 8},
{value : 9},
{value : 10}
]]>
</mx:Script>
<mx:DataGrid x="40" y="36" width="408" height="193" dataProvider="{ac}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="value" itemRenderer="MyComp"/>
<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
I hope this helps
Andrew -
Set background color when condition applied
hi,
Can anybody tell me how to set background color when condition applied.
My initial plan was to highlight a specify row(Change color) when the third column of this JTable consists of OK word.
int rowCount = table.getRowCount();
for(int i=0 ;i <rowCount ; i++)
String word = table.getValueAt(i,3).toString();
if(word.equals("Word")) {
table.setSelectionBackground(Color.red);
break;
else {
table.setBackground(getBackground());
Thanks.import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
public class TableChanges
public TableChanges()
String[] headers = { "column 1", "column 2", "column 3", "column 4" };
int rows = 18;
int cols = 4;
String[][] data = new String[rows][cols];
for(int row = 0; row < rows; row++)
for(int col = 0; col < cols; col++)
data[row][col] = "item " + (row * cols + col + 1);
JTable table = new JTable(data, headers);
// add custom cell renderer to each column
TableColumnModel columnModel = table.getColumnModel();
for(int j = 0; j < columnModel.getColumnCount(); j++)
TableColumn col = columnModel.getColumn(j);
col.setCellRenderer(new CellRenderer());
// add table model listener to listen for cell edits
// so we can detect our special selection edit value
// which is "word"
TableModel tableModel = table.getModel();
tableModel.addTableModelListener(new ModelListener(table));
JScrollPane scrollPane = new JScrollPane(table);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(scrollPane);
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
Dimension d = scrollPane.getViewport().getSize();
table.setRowHeight(d.height/rows);
public static void main(String[] args)
new TableChanges();
class ModelListener implements TableModelListener
JTable table;
public ModelListener(JTable table)
this.table = table;
public void tableChanged(TableModelEvent e)
int firstRow = e.getFirstRow();
int lastRow = e.getLastRow();
int colIndex = e.getColumn();
if(e.getType() == TableModelEvent.UPDATE &&
firstRow != TableModelEvent.HEADER_ROW &&
colIndex != TableModelEvent.ALL_COLUMNS &&
colIndex == 2) // column 3 only
String value = (String)table.getValueAt(firstRow, colIndex);
// check for our special selection criteria
if(value.equals("word"))
for(int j = 0; j < table.getColumnCount(); j++)
CellRenderer renderer =
(CellRenderer)table.getCellRenderer(firstRow, j);
renderer.setSpecialSelection(firstRow, j);
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.black;
if(hasFocus)
color = Color.blue;
else if(isSelected)
color = Color.green.darker();
else if(row == specRow && col == specCol)
color = color.red;
setForeground(color);
setText((String)value);
return this;
public void setSpecialSelection(int row, int col)
specRow = row;
specCol = col;
} -
TableView - different background color of header cell
Hello,
I'd like to render table view with header cell of certain background color.
I think I can use <i> IHeaderCellRenderer </i> but I can't find out how to set background color from javadoc.
Best regards,
Josef MotlTry using something like:
tableView.setStyleForCell(i, column, TableCellStyle.SUBTOTAL);
Best regards
Francisco -
Set Background color for headers in excel
DECLARE
v_fh UTL_FILE.file_type;
v_dir VARCHAR2 (30) := 'my dir';
v_file VARCHAR2 (30) := 'test.xls';
PROCEDURE run_query (p_sql IN VARCHAR2)
IS
v_v_val VARCHAR2 (4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.desc_tab;
col_num NUMBER;
BEGIN
c := DBMS_SQL.open_cursor;
-- parse the SQL statement
DBMS_SQL.parse (c, p_sql, DBMS_SQL.native);
-- start execution of the SQL statement
d := DBMS_SQL.EXECUTE (c);
-- get a description of the returned columns
DBMS_SQL.describe_columns (c, col_cnt, rec_tab);
-- bind variables to columns
FOR j IN 1 .. col_cnt
LOOP
CASE rec_tab (j).col_type
WHEN 1
THEN
DBMS_SQL.define_column (c, j, v_v_val, 4000);
WHEN 2
THEN
DBMS_SQL.define_column (c, j, v_n_val);
WHEN 12
THEN
DBMS_SQL.define_column (c, j, v_d_val);
ELSE
DBMS_SQL.define_column (c, j, v_v_val, 4000);
END CASE;
END LOOP;
-- Output the column headers
UTL_FILE.put_line (v_fh, '<ss:Row>');
FOR j IN 1 .. col_cnt
LOOP
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| rec_tab (j).col_name
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
END LOOP;
UTL_FILE.put_line (v_fh, '</ss:Row>');
-- Output the data
LOOP
v_ret := DBMS_SQL.fetch_rows (c);
EXIT WHEN v_ret = 0;
UTL_FILE.put_line (v_fh, '<ss:Row>');
FOR j IN 1 .. col_cnt
LOOP
CASE rec_tab (j).col_type
WHEN 1
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| v_v_val
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
WHEN 2
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_n_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="Number">'
|| TO_CHAR (v_n_val)
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
WHEN 12
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_d_val);
UTL_FILE.put_line (v_fh,
'<ss:Cell ss:StyleID="OracleDate">'
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="DateTime">'
|| TO_CHAR (v_d_val,
'YYYY-MM-DD"T"HH24:MI:SS'
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
ELSE
DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| v_v_val
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
END CASE;
END LOOP;
UTL_FILE.put_line (v_fh, '</ss:Row>');
END LOOP;
DBMS_SQL.close_cursor (c);
END;
PROCEDURE start_workbook
IS
BEGIN
UTL_FILE.put_line (v_fh, '<?xml version="1.0"?>');
UTL_FILE.put_line
(v_fh,
'<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
END;
PROCEDURE end_workbook
IS
BEGIN
UTL_FILE.put_line (v_fh, '</ss:Workbook>');
END;
PROCEDURE start_worksheet (p_sheetname IN VARCHAR2)
IS
BEGIN
UTL_FILE.put_line (v_fh,
'<ss:Worksheet ss:Name="' || p_sheetname || '">'
UTL_FILE.put_line (v_fh, '<ss:Table>');
END;
PROCEDURE end_worksheet
IS
BEGIN
UTL_FILE.put_line (v_fh, '</ss:Table>');
UTL_FILE.put_line (v_fh, '</ss:Worksheet>');
END;
PROCEDURE set_date_style
IS
BEGIN
UTL_FILE.put_line (v_fh, '<ss:Styles>');
UTL_FILE.put_line (v_fh, '<ss:Style ss:ID="OracleDate">');
UTL_FILE.put_line
(v_fh,
'<ss:NumberFormat ss:Format="dd/mm/yyyy\ hh:mm:ss"/>'
UTL_FILE.put_line (v_fh, '</ss:Style>');
UTL_FILE.put_line (v_fh, '</ss:Styles>');
END;
BEGIN
v_fh := UTL_FILE.fopen (v_dir, v_file, 'w', 32767);
start_workbook;
set_date_style;
start_worksheet ('OM');
run_query ('select PARTY_ID,PARTY_NAME from HZ_PARTIES
where PARTY_ID<1080');
end_worksheet;
start_worksheet ('PO');
run_query ('SELECT AGENT_ID,TYPE_LOOKUP_CODE FROM PO_HEADERS_ALL
WHERE PO_HEADER_ID<20');
end_worksheet;
end_workbook;
UTL_FILE.fclose (v_fh);
END;
Here i will get two outputs in same excel with different spread sheets,
now i want to set background color for headers i
ex:PARTY_ID,PARTY_NAME,AGENT_ID,TYPE_LOOKUP_CODE are the headers,in excel output i want background color as blue.
Please do need full help,its urgent req.Hello,
open the file in Excel and save it, just to ensure that Excel writes all the additional stuff it thinks is necessary.
Now change the background colour of the header and save the file again but with a different name.
Open both files in a text editor and look at the differences. That's what you need to change in your code.
Alternatively you can use packages like xml_spreadsheet or ExcelDocumentType, both write the same file format that you use in your code and you don't have to reinvent the wheel.
Regards
Marcus -
Hi gurus,
I have written a procedure to change the background color of the cell in EXCEL.The code is as below..
PROCEDURE set_header (p_row IN NUMBER, p_col IN NUMBER, p_value IN VARCHAR2, p_border IN VARCHAR2 DEFAULT 'N',p_bgcolor IN VARCHAR2 DEFAULT 'N') IS
BEGIN
v_args := ole2.create_arglist;
ole2.add_arg(v_args, p_row);
ole2.add_arg(v_args, p_col);
v_cell := ole2.get_obj_property(v_worksheet, 'cells', v_args);
v_font := ole2.get_obj_property(v_cell, 'font');
ole2.set_property(v_font, 'fontstyle', 'bold');
ole2.set_property(v_font, 'size', 9);
ole2.destroy_arglist(v_args);
if p_border = 'Y' THEN
v_border := ole2.get_obj_property(v_cell, 'Borders');
ole2.set_property(v_border, 'LineStyle', 1);
ole2.release_obj(v_border);
End If;
if p_bgcolor ='Y' THEN
v_bgcolor := ole2.get_obj_property(v_cell,'Bgcolor'); --This is not woking
ole2.set_property(v_bgcolor,'bgcolor','red');
ole2.release_obj(v_bgcolor);
End If;
ole2.set_property(v_cell, 'value', p_value);
ole2.release_obj(v_cell);
END set_header;
Pls tell me how to change the backcolor and forecolor in the cell...
ThanksThe background color is set for the "Interior" object of the selected cells (Range).
Try something like this (haven't tested it):
v_interior := ole2.get_obj_property(v_cell,'Interior');
ole2.set_property(v_interior,'ColorIndex',3); --should be red
ole2.release_obj(v_interior);
If the Foreground color = Font Color then
ole2.set_property(v_font,'ColorIndex',6); --should be yellow
Gerald -
How to change the Background color of a cell in JTable
hi!
Actually i want to change the background color of few cells in JTable
is there any method to make this change in JTable ?
and also is it possible to have 5 rows with single column and 5 rows with 3 columns in a single JTablei want to change the background color of few cells in JTableDepending on your requirements for the coloring of cells it may be easier to override the prepareRenderer() method of JTable:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474 -
Change the background color of a cell in JTable
Hi all,
How can I change the background color of individual cell in JTable. I need to construct my own TableCellRenderer or not? I'm now using the DefaultTableCellRenderer now.
ThxYou could create your own renderer or you could try something like:
table = new JTable(model)
public TableCellRenderer getCellRenderer(int row, int column)
DefaultTableCellRenderer tcr =
(DefaultTableCellRenderer)super.getCellRenderer(row, column);
if (row == 1 && column == 1)
tcr.setBackground(Color.green);
else
tcr.setBackground(Color.red);
return tcr;
}; -
How to set background color in PL/SQL
Hi,
I have tried to set background color in SQL Query. When I execute in Report Region, I am not getting the background color.
SELECT first query
UNION
SELECT ' || v_sel_organization_id || ' organization_id FROM DUAL) org , hr_all_organization_units haou WHERE positions_set.position_id = allocations_set.position_id(+) AND org.organization_id = positions_set.organization_id AND positions_set.position_id = encumbrance_set.enc_position_id(+) AND positions_set.position_id = payclass_set.position_id(+) AND org.organization_id = haou.organization_id AND TRUNC (SYSDATE) BETWEEN haou.date_from AND NVL (haou.date_to, TRUNC (SYSDATE)) AND (NVL (allocations_set.allocations, 0) + NVL (encumbrance_set.enc_count, 0) + NVL (payclass_set.pay_count, 0)) != 0 union select null , '' '' ,'' '',''<SPAN STYLE="background-color: red;">Total</span>'' ,''' || v_sum_alloc ||''','|| v_sum_vac ||','''|| v_sum_encum ||''',''' || v_sum_pay ||''' ,null,null,null,null,2 from dual' ; Can anyone help me to resolve this issue.
Regards
Balaji S
Edited by: Balaji Subramaniam on Jan 19, 2010 5:53 PM
Edited by: Balaji Subramaniam on Jan 19, 2010 5:53 PM
Edited by: Balaji Subramaniam on Jan 19, 2010 6:46 PM
Edited by: Balaji Subramaniam on Jan 19, 2010 6:48 PMHi
A couple of things...
Thats SQL - not PL/SQL
That is not a valid SQL statement, I'm surprised its not giving an error. Please post the exact region source.
When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
{noformat}{noformat}
SELECT *
FROM emp
{noformat}{noformat}
It will then appear like this... SELECT *
FROM emp
Cheers
Ben -
How to set background color in JTF GRID
Is it possible to set background color in JTF GRID ?
Hello Pavo,
it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
br
Peter -
How to set background color in row of JTable ?
i am new in java please tell me about How to set background color in row of JTable ? please example code. Thnak you.
Here is an example: http://www.javaworld.com/javaworld/javaqa/2001-09/03-qa-0928-jtable.html
For more info on how to use tables read the swing tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
ICE -
How to set background color in af:inputText in an af:table
Hi,
how to set background color in af:inputText in an af:table depending on the value of af:inputText.
For example, how to set background red if the af:inpuText is empty
ThanksHello Pavo,
it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
br
Peter -
How to set background color for selected days in DateChooser
How to set background color for selected days. I created
checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
DateChooser, I want to change the background color for the selected
day when i click on a button after selecting the desired checkboxs
[ monthly wise/yearly wise]
Thanks in advanceThere is no button involved in the following code, but it may
be of use to you:
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
private var origColor:uint;
private function init():void {
origColor = dc.getStyle("selectionColor");
public function setBackGrdColors(newColor:uint):void {
dc.setStyle("selectionColor", origColor);
if(dc.selectedDate){
var dayOfWeek:Number = dc.selectedDate.day;
else{
return;
switch(dayOfWeek) {
case 0:
if(sun.selected)
dc.setStyle("selectionColor", newColor);
break;
case 1:
if(mon.selected)
dc.setStyle("selectionColor", newColor);
break;
case 2:
if(tue.selected)
dc.setStyle("selectionColor", newColor);
break;
case 3:
if(wed.selected)
dc.setStyle("selectionColor", newColor);
break;
case 4:
if(thu.selected)
dc.setStyle("selectionColor", newColor);
break;
case 5:
if(fri.selected)
dc.setStyle("selectionColor", newColor);
break;
case 6:
if(sat.selected)
dc.setStyle("selectionColor", newColor);
break;
default:
break;
]]>
</mx:Script>
<mx:VBox horizontalAlign="center" verticalGap="20">
<mx:DateChooser id="dc" textAlign="left"
change="setBackGrdColors(cellColor.selectedColor)"/>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="sun" label="Sun"/>
<mx:CheckBox id="mon" label="Mon"/>
<mx:CheckBox id="tue" label="Tue"/>
<mx:CheckBox id="wed" label="Wed"/>
</mx:HBox>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="thu" label="Thu"/>
<mx:CheckBox id="fri" label="Fri"/>
<mx:CheckBox id="sat" label="Sat"/>
</mx:HBox>
<mx:HBox width="300" horizontalAlign="center">
<mx:Label text="Background Color" />
<mx:ColorPicker id="cellColor"
selectedColor="#FF00FF"/>
</mx:HBox>
</mx:VBox>
</mx:Application> -
How to control background color of table cell in an html report?
I am using Labview 6.1 to generate a report. In that report there is a table created using the Append Numeric Table to Report VI. I want to be able to programmatically control the background color of each cell in the table. Also, how can I programmatically control the background color of the row and header cells of the same table. I am also generating a second table in the same report using the Append Text Table to Report VI and I would like to programmatically control the background colors of the cells in that table as well. Thanks.
Hi epsilon-d...,
i´m not sure if there is an ready to use function to do what you want, but you can enlarge the available function. Open the "Append Numeric Table to Report.vi" and go to the HTML Case. There you can see another vi which creates the html table. In the VI "HTML Report Table Row" you can add the option: bgcolor="your color" inside of the "TR" tag.
Hope it helps.
Mike
Maybe you are looking for
-
Reg:file to idoc scenario
In a file-xi-idoc scenario i created a business service for legacy system and a business system for R/3 receiver system i didn't assign logical system for the sender business service and assigned a logical system for the reciver business system so wh
-
HT4095 I have downloaded a movie but can't figure out how to play it help?
I can't view the movie I have downloaded. Please help
-
Why do the site's propietary icons disappear after dragging to the taskbar?
I've found a site I absolutely need in my taskbar, when I drag the icon down the link is there but the icon has been lost somewhere. The icons are usually proprietary so I can't even edit the quicklaunch to find the image. Why does this happen, and h
-
Reducing the time in Queues- IE
Hi all, My problem is ,for picking the message from the sender queue-> IE->Receiver queue ,to pick the message from the sender queue and place in the Integration engine much time is wasted.Is there any way to decrease this time. Kindly let me know. T
-
Problem with Adobe Flash Player, download the new update
Hello, I have a problem when I try to download the new version of Adobe Flash Player. I have no problem to download the file on my computer ( install_flashplayer13x32_mssd_aaa_aih.exe ) (Adobe - Installer Adobe Flash Player), When I clicked on it ask