Smartform dynamic cell coloring
Hello guys
I'd like to ask you a question regarding this issue (I'm not really an expert in Smartform development)
The question is the following: Is there any way to dynamically set a table cell's color?
Rigth now I have an ALV populated with data, and depending on some fields' values, I'm setting the cell's color dynamically at runtime (This is really easy using 00 ALV), but now I've been told to do the same in a smartform.
I've been doing some digging , but so far i couldn't figure out how to do it; actually, I don't even know if it is possible.
Thanks in advance.
Regards boborolos.
Hi,
smartforms is used for printable forms and not for graphics. You can design your table and assign colors to columns/lines but this is done manually and static; if you need to do it dynamically, then smartforms is not the tool to use (and I think Adobe Forms has the same problem).
You should try something else, like Crystal Reports or some other tool.
Similar Messages
-
I would like to create a Data Grid where the individual cell
colors change based on the number in the cell.
For example, numbers between 0 and 1 would be green, between
1 and 2 would be yellow, and between 3 and 4 would be red.
I am wondering if this is even possible, or if I am going to
have to find another solution other than the data grid component.
Not looking for a complete answer (but I'd be happy to have
one!) but any pointing in the right direction would be great.
I have a lot of data and coloring the cells by hand is not an
option. I don't even know if I can change individual cell colors in
the data grid- if it isn't possible I'd be willing to change the
text color instead.
Any suggestions?
Thanks!Example query:
select cust.*
, case when credit_limit > 5000 then 'red' else 'green' end as bg_color
from (
select
CUSTOMER_ID,
CUST_FIRST_NAME,
round(dbms_random.value(1000,9000)) as CREDIT_LIMIT
from #OWNER#.DEMO_CUSTOMERS
) custIn the Column Definition of CREDIT_LIMIT, set the HTML-Expression to <div style="background-color:#BG_COLOR#">#CREDIT_LIMIT#</div>
See result : http://apex.oracle.com/pls/apex/f?p=41715:3
You could also construct the whole html in the SQL but I like to divide logic (SQL) and UI.
Another option could be to create a Dynamic Action (After Refresh of the report region) and create a combination of a nifty selector and piece of JavaScript, but I guess this is easier. -
How do i change the cell color of each cell in datagrid dynamically
I have a datagrid filled in with data..My job is to change the cell color of a particular cell in the datagrid when the user clicks that cell..Please help me asap..I have to change the color of each cell dynamically..
Pls find the solution of ur problem.Let me know if you have any issue.
MainApplicaion.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.ListEvent;
[Bindable]
private var listDataArrayCollection:ArrayCollection=
new ArrayCollection([
{seq:'1',color:'0xFF0000', names:'John'},
{seq:'2',color:'0x00FF00', names:'Alex'},
{seq:'3',color:'0x0000FF', names:'Peter'},
{seq:'4',color:'0xFF0000', names:'Sam'},
{seq:'5',color:'0x00FF00', names:'Alis'},
{seq:'6',color:'0x0000FF', names:'Robin'},
{seq:'7',color:'0xFF0000', names:'Mark'},
{seq:'8',color:'0x00FF00', names:'Steave'},
{seq:'9',color:'0x0000FF', names:'Fill'},
{seq:'10',color:'0xFF0000', names:'Abraham'},
{seq:'11',color:'0x00FF00', names:'Hennery'},
{seq:'12',color:'0x0000FF', names:'Luis'},
{seq:'13',color:'0xFF0000', names:'Herry'},
{seq:'14',color:'0x00FF00', names:'Markus'},
{seq:'15',color:'0x0000FF', names:'Flip'},
{seq:'16',color:'0xFF0000', names:'John_1'},
{seq:'17',color:'0x00FF00', names:'Alex_1'},
{seq:'18',color:'0x0000FF', names:'Peter_1'},
{seq:'19',color:'0xFF0000', names:'Sam_1'},
{seq:'20',color:'0x00FF00', names:'Alis_1'},
{seq:'21',color:'0x0000FF', names:'Robin_1'},
{seq:'22',color:'0xFF0000', names:'Mark_1'},
{seq:'23',color:'0x00FF00', names:'Steave_1'},
{seq:'24',color:'0x0000FF', names:'Fill_1'},
{seq:'25',color:'0xFF0000', names:'Abraham_1'},
{seq:'26',color:'0x00FF00', names:'Hennery_1'},
{seq:'27',color:'0x0000FF', names:'Luis_1'},
{seq:'28',color:'0xFF0000', names:'Herry_1'},
{seq:'29',color:'0x00FF00', names:'Markus_1'},
{seq:'30',color:'0x0000FF', names:'Flip_2'}
private function onItemClick(event : ListEvent):void
var dataObj : Object = event.itemRenderer.data;
dataObj.color = "0xFF00FF";
event.itemRenderer.data = dataObj;
]]>
</mx:Script>
<mx:VBox width="300" height="100%"
horizontalAlign="center"
verticalAlign="middle">
<mx:DataGrid id="listComponent" width="50%"
height="100%"
borderStyle="none"
dataProvider="{listDataArrayCollection}"
itemClick="onItemClick(event)">
<mx:columns>
<mx:DataGridColumn width="100" dataField="{data.seq}" headerText="Seq" itemRenderer="SeqItemRenderer" />
<mx:DataGridColumn width="100" dataField="{data.names}" headerText="Name" itemRenderer="NameItemRenderer"/>
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:Application
NameItemRenderer.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
width="100" height="30" horizontalGap="5" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
super.data = value;
]]>
</mx:Script>
<mx:TextInput width="75" height="30"
text="{data.names}"
editable="false" backgroundColor="{data.color}"/>
</mx:HBox>
SeqItemRenderer.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
width="100" height="30" horizontalGap="5" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
super.data = value;
]]>
</mx:Script>
<mx:TextInput width="75" height="30"
text="{data.seq}"
editable="false" backgroundColor="{data.color}"/>
</mx:HBox>
with Regards,
Shardul Singh Bartwal -
Set Cell Color without using DefaultTableCellRenderer
Hi,
Is there any possible to set the JTable cell color without using DefaultTableCellRenderer ?. For ex, I have one JTable that having 9 rows and 9 columns. I have to set the cell color in 2nd row & 3rd column.
Please anyone give me guidance to solve this.
Thanks & Regards
S SenthilkumarFine.. Please try to understand my points.
Because in my application I have JTable that having 10 columns and rows dynamically will come based on the value fetch from arraylist. If I use DefaultTableCellRenderer, for each record its calling CustomTableCellRenderer(). For example arraylist return 10 rows means its looping 100 times(10 rows * 10 columns).
CustomTableCellRenderrer.java
ArrayList dataLiveMarket = (ArrayList) new CheckUser().getLiveMarketDetails(unval);
CustomTableModel modelLiveMarket = new CustomTableModel(dataLiveMarket);
JTable tableOne = new JTable(modelLiveMarket);
tableOne.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
CustomTableCellRenderrer.java
package com.fxtrading.dao;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableModel;
* @author user
public class CustomTableCellRenderer extends DefaultTableCellRenderer {
//private TableModel bidLastPrice;
//int k;
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus,
int row, int column) {
Component component =
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (column == 0 || column == 1|| column == 2) {
setHorizontalAlignment(SwingConstants.LEFT);
} else if(column == 3 || column == 4 || column == 5 || column == 6 || column == 7 || column == 8){
setHorizontalAlignment(SwingConstants.RIGHT);
}else if(column == 9){
setHorizontalAlignment(SwingConstants.CENTER);
// Change cell Color - Started
bidLastPrice = table.getModel();
int bidLastRowCount =(int)table.getRowCount();
for(k=0; k<bidLastRowCount; k++) {
String bidPrice = (String)bidLastPrice.getValueAt(k,4);
String lastPrice = (String)bidLastPrice.getValueAt(k,8);
bidPrice = bidPrice.replace(",","").replace("$","");
lastPrice = lastPrice.replace(",","").replace("$","");
if(Double.parseDouble(bidPrice)<Double.parseDouble(lastPrice)){
if(row == k && column == 4){
component.setBackground(Color.RED);
}else{
component.setBackground(Color.WHITE);
System.out.println("Row Count -->"+k+" Less ----> Bid Price----> "+Double.parseDouble(bidPrice)+" : Last Price----> "+Double.parseDouble(lastPrice));
}else{
if(row == k && column == 4){
component.setBackground(Color.GREEN);
}else{
component.setBackground(Color.WHITE);
System.out.println("Row Count -->"+k+" More ----> Bid Price----> "+Double.parseDouble(bidPrice)+" : Last Price----> "+Double.parseDouble(lastPrice));
// Change cell Color - End
return component;
}Thanks & Regards,
S Senthilkumar -
Cell Color after uploading a graphics
Hi,
I'm required to upload graphics in the smartforms I'm developing. The Cell in my template has to be gray but when I'm uploading the graphics the shading & bording of the graphic is white so the cell i'm getting is gray with white. How can I get rid of the white portion in the cell.I have tried this.. and it is working very well on my system..
I have kept the cell color as Gray and I have uploaded the graphic (That is having white color border) within the cell ... All are perfect...
Try this in your Graphic window -> General Attributes -> Tech attributes -> Resolution -- > Keep it at 100 or 150 DPI
Hope you get something..
Best luck..
Regs,
Lokesh -
Report Generation broken after deployment - Excel Set Cell Color and Border.vi
Upon deployment, the Excel Set Cell Color and Border.vi became broken. After installing LV2010 SP1 to view the VIs in the deployment, I noticed that in the second case structure where the code draws the border using the BorderAround invoke node, there is an extra variant input parameter named 'Parameters'. Upon right-clicking, an option to 'Relink Invoke Node' appeared and after selecting this, the extra input disappeared and the VI was no longer broken.
Why does "Relink Invoke Node" appear? How do I create a deployment with this issue? Has anybody else experienced this? Why is the TestStand deployment so buggy?Hi Ching-Hwa,
I have set up a test deployment here where I am deploying a workspace that contains a sequence file. This sequence file has a LabVIEW Action Step calling a VI that opens a new Excel file and simply calls the Excel Set Cell Color and Border VI. After deploying this, both the VI and my test sequence ran on the deployment machine without error. Therefore, I do have some more questions to more accurately reproduce what you are seeing.
First, what operating systems are you developing on and deploying to? Also, what license do you have for TestStand on the machine you are deploying to? If you have a development version, can you manually take the sequence file and VI to this machine and run it? I know you now have LabVIEW 2010 SP1 on your development machine, but if you have the development version of TestStand as well, it would be interesting to see if you copy the files over if you still see this behavior. Are you including the TestStand Engine in the deployment?
Can you open a blank VI on the deployment machine and add the Excel Set Cell Color and Border VI? It would also be interesting to see if this is not a product of the deployment, but rather an issue with something on the deployment machine itself. What version of the Report Generation Toolkit do you have on each machine? Also, what versions of Excel are you using on the development and deployment machine? Again, it would be helpful for me to know exactly what versions you have installed on both the development and deployment machines so that I can reproduce this as accurately as possible.
One last thing to try, too, would be to try deploying the VI by itself just to see if it also has the same behavior. Do you have the Application Builder in LabVIEW? If so, could you also try building an executable from the VI, create an installer, and deploy this to the deployment machine?
In regards to the "freezing" of code by removing the block diagrams, I do not believe this will be a proper work around in this case. While this removes the block diagram from actually being deployed along with the VI and restricts users from editing the code on the deployment machine, if something is getting changed in the compiled code upon deployment, this will not stop this from happening. This option is available more as a memory option to lower the size of the deployment as well as prohibit any users on the development machine from editing the block diagram themselves.
Thanks, Ching-Hwa! I look forward to your response so that I can continue trying to reproduce this issue. Have a great day!
Taylor G.
Product Support Engineer
National Instruments
www.ni.com/support -
Hi All
I would be greatful if someone could please help...
I am still attempting to get cells painted within a WDA ALV grid display.
I have tried to use the method stated in the WDA sap press book - but this method is for use with TABLE element and I am using a ViewContainerUIElement for my table. There are mentions of wonderful ways to color cells in a list display - but I cannot understand how this can be achieved. I currently have this working appart from the numeric numbers of the design being set into the relavant column cell.
If anyone could help that would be great...
Please see: http://picasaweb.google.co.uk/dave.alexander69/Pictures#5244800978549492338
LOOP AT lt_zdata INTO ls_zdata.
lv_index = sy-tabix.
* set column values
* loop at row data and set colour attributes of individual cells
LOOP AT lt_columns ASSIGNING <fs_column>.
lr_col_header = <fs_column>-r_column->get_header( ).
lr_col_header->set_ddic_binding_field( ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = <fs_column>-id.
lr_column = lr_column_settings->get_column( <fs_column>-id ).
* for the date columns only...
IF <fs_column>-id(4) = 'CELL'.
* get and set column dates from select option user input
READ TABLE lt_dates INTO ls_dates INDEX 1.
IF lt_dates IS INITIAL.
lr_col_header->set_text( 'Date' ).
ELSE.
ls_dates-low = ls_dates-low + lv_incr_date.
MOVE ls_dates-low+2(2) TO lv_for_col_date+6(2). "Year
MOVE ls_dates-low+4(2) TO lv_for_col_date+3(2). "Month
MOVE ls_dates-low+6(2) TO lv_for_col_date(2). "Day
MOVE lv_for_col_date TO lv_col_date.
lr_col_header->set_text( lv_col_date ).
lv_incr_date = lv_incr_date + 7.
ENDIF.
LOOP AT lt_orgdata_dates INTO ls_orgdata_dates
WHERE crew = ls_zdata-crew
AND position = ls_zdata-position
AND name = ls_zdata-person
AND trip_arr >= ls_dates-low
AND trip_dep <= ls_dates-low.
* column heading settings
lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
* trying to set cell variants ?@#??!!???
* lr_cv = lr_column->set_key( ls_zdata-variance ).
* lr_cv->set_editor( lr_input_field ).
* lr_cv->set_cell_design( value = '01').
* lr_column->add_cell_variant( lr_cv ).
* current method of seeting the cell colors... (but puts value in cell!)
FIELD-SYMBOLS: <fs> TYPE data.
lr_column->set_cell_design_fieldname( value = <fs_column>-id ).
ASSIGN COMPONENT <fs_column>-id OF STRUCTURE ls_zdata TO <fs>.
WRITE: CL_WD_TABLE_COLUMN=>e_cell_design-one TO <fs>.
MODIFY lt_zdata FROM ls_zdata. " INDEX lv_index.
ENDLOOP.
ENDIF.
Kind Regards
Dave AlexanderHi check this code to set cell colors for ALV grid.
Take a context attribute with type WDUI_TABLE_CELL_DESIGN.
Here i am populating colors based on some condition.Check the loop of the internal table.
method get_flight_details .
data:node_flights type ref to if_wd_context_node,
it_flights type sflight_tab1,
ls_flights type sflight,
it_final type if_componentcontroller=>elements_flights,
ls_final type if_componentcontroller=>element_flights.
select * from sflight into table it_flights
up to 100 rows.
node_flights = wd_context->get_child_node( 'FLIGHTS' ).
loop at it_flights into ls_flights.
move-corresponding ls_flights to ls_final.
if ls_final-price = '185.00'.
ls_final-readonly = abap_true.
ls_final-celldesign =
cl_wd_table_column=>e_cell_design-badvalue_light.
else.
ls_final-readonly = ' '.
ls_final-celldesign =
cl_wd_table_column=>e_cell_design-goodvalue_light.
endif.
append ls_final to it_final.
endloop.
node_flights->bind_table(
new_items = it_final
set_initial_elements = abap_true
* INDEX = INDEX
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
data:
l_value type ref to cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model(
* Make Price column editable
data:l_column type ref to cl_salv_wd_column,
l_column1 type ref to cl_salv_wd_column,
lr_input type ref to cl_salv_wd_uie_input_field,
l_input1 type ref to cl_salv_wd_uie_input_field.
l_column = l_value->if_salv_wd_column_settings~get_column( 'PRICE' ).
create object lr_input
exporting
value_fieldname = 'PRICE'
l_column->set_cell_editor( value = lr_input ).
* to make some cells non editable
lr_input->set_read_only_fieldname( value = 'READONLY' ).
l_value->if_salv_wd_column_settings~delete_column( id = 'READONLY' )
*Set the table Editable
l_value->if_salv_wd_table_settings~set_read_only( value = abap_false ).
*Give colors to cells
l_column1 = l_value->if_salv_wd_column_settings~get_column( 'CARRID' ).
l_column1->set_cell_design_fieldname( value = 'CELLDESIGN' ).
l_value->if_salv_wd_column_settings~delete_column( id = 'CELLDESIGN' )
endmethod.
Thanks
Suman -
Mouse over to change cell color
Can anyone point me to a really good tutorial for doing mouse
over also
changes the cell color?.
Ive tried a few and spent hours on it and just cannot get it
to work
correctly.
Here is my basic starting .css which i start off with each
time.
.tnav {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
.tnav a:link {
color: #FFFFFF;
font-size: 12px;
text-decoration: none;
.tnav a:visited {
color: #FFFFFF;
text-decoration: none;
.tnav a:hover {
color: #FFFFFF;
text-decoration: underline;
.tnav a:active {
color: #FFFFFF;On Thu, 8 Mar 2007 14:42:35 -0000, "Mike"
<[email protected]> wrote:
>Can anyone point me to a really good tutorial for doing
mouse over also
>changes the cell color?.
Change your CSS to this:
.tnav {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
.tnav a {
color: #FFFFFF;
display: block;
text-decoration: none;
.tnav a:hover {
color: #FFFFFF;
text-decoration: underline;
Add a conditional comment to the <head> of the document
to correct for
an IE browser bug:
<!--[if ie]>
<style type="text/css">
.tnav a {
height: 1%;
</style>
<![endif]-->
Gary -
Can we pass dynamic cell associated value [of scorecard] as query string parameter in custom hyperlink property of KPI of scorecard in PPS SP2013 , so that we can pass those values to another page
How to get those cell associated values and set these dynamic value as query string parameter in custom hyperlink property of KPI of scorecard in performance point services in sharepoint 2013I could somehow link to the table name, but that can be changed... Any ideas?
Not sure if this will help or not but maybe a little from several areas might point you in the right direction.
If you are concerned about users changing the table name then you can define a name to reference the table and then if the user changes the table name then the Refers to automatically changes to the new table reference but your defined name remains the same.
However, if users want to break a system even when you think you have it bullet proof the users come along with armour piercing bullets.
Example:
Insert a table (say Table1)
Go to Define a name and insert a name of choice (eg. ForMyTab1)
Then click the icon at the right of the Refers to field and select the entire table including the column headers and it will automatically insert something like the following in the Refers to field.
=Table1[#All]
Now if a user changes the table name then Table1 will also automatically change.
Example code to to reference the table in VBA.
Sub Test()
Dim wsSht1 As Worksheet
Dim lstObj1 As ListObject
Set wsSht1 = Worksheets("Sheet1")
Set lstObj1 = wsSht1.ListObjects(Range("ForMyTab1").ListObject.Name)
MsgBox lstObj1.Name
End Sub
Regards, OssieMac -
SSRS Reporting : Fill Cell Color according to the Location of the Cell in the Matrix
Hello,
I am trying to achieve below result in the SSRS but facing issues with Cell color Fill Expression when Detail value is NULL.
If you look at the image, it should show exact same colors of the cell irrespective of the values.
But in my case it is not showing color for NULL value cells.
Below is the expression which I have put in the Fill Expression window.
SWITCH(
Fields!Columns.Value = "Col1" And Fields!Rows.Value = "Row1","Yellow",
Fields!Columns.Value = "Col1" And Fields!Rows.Value = "Row2","Green",
Fields!Columns.Value = "Col1" And Fields!Rows.Value = "Row3","Green",
Fields!Columns.Value = "Col1" And Fields!Rows.Value = "Row4","Green",
Fields!Columns.Value = "Col2" And Fields!Rows.Value = "Row1","Red",
Fields!Columns.Value = "Col2" And Fields!Rows.Value = "Row2","Yellow",
Fields!Columns.Value = "Col2" And Fields!Rows.Value = "Row3","Yellow",
Fields!Columns.Value = "Col2" And Fields!Rows.Value = "Row4","Green",
Fields!Columns.Value = "Col3" And Fields!Rows.Value = "Row1","Red",
Fields!Columns.Value = "Col3" And Fields!Rows.Value = "Row2","Red",
Fields!Columns.Value = "Col3" And Fields!Rows.Value = "Row3","Yellow",
Fields!Columns.Value = "Col3" And Fields!Rows.Value = "Row4","Green"
Please suggest me to get the colors for the NULL value cells.
I tried with IsNothing() but then it is doing the same color of all NULL cells. I want them exactly same in the figure.
Thank you,
Mittal.Hi Mittal,
Based on your dataset table, the matrix should displays as below. Are you manually insert Row1 row and Col3 column in the matrix?
If that is true, the Fill cell color should be displayed as the picture above. Because there are no values for Rows=Row1 and Columns= Col1, Rows=Row1 and Columns= Col2… the expression for those cells has no effect. To achieve your requirement, we can manually
insert those values in the dataset query like below:
SELECT Columns, Rows, Value FROM table
UNION all
select 'Col1' AS Columns, 'Row1' AS Rows, NULL AS Value
UNION all
select 'Col1' AS Columns, 'Row3' AS Rows, NULL AS Value
UNION all
select 'Col2' AS Columns, 'Row1' AS Rows, NULL AS Value
UNION all
select 'Col2' AS Columns, 'Row4' AS Rows, NULL AS Value
UNION all
select 'Col3' AS Columns, 'Row1' AS Rows, NULL AS Value
UNION all
select 'Col3' AS Columns, 'Row2' AS Rows, NULL AS Value
UNION all
select 'Col3' AS Columns, 'Row3' AS Rows, NULL AS Value
UNION all
select 'Col3' AS Columns, 'Row4' AS Rows, NULL AS Value
Then directly add those three field with the fill cell color expression to matrix, the matrix displays:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Excel Set Cell Color and Border.viのbackground color 設定について
お世話になっております。
Microsoft オフィス用レポート生成ツールキットを使って
LabVIEWで収集したデータをExcelファイルで出力しようと考えています。
そこで質問が有ります。
題名のようにExcel Set Cell Color and Border.viのbackground color 設定についてです。
デフォルト(未配線)では白に設定されていますが、”色なし”に設定するにはどうしたら良いのでしょうか?
又、罫線色等を指定する数値設定に関しては、何処を調べたら良いのでしょうか?
ご教授の程、宜しくお願い致します。_YN 様
平素よりNI製品をご利用頂きまして誠にありがとうございます。
日本ナショナルインスツルメンツ技術部の湧川と申します。
ご質問にお答え致します。
色なしにしたいとの事ですが、こちらでExcel Set Cell Color and Border.viを使用して簡単なVIを実行させてみましたが色なしに設定することはできませんでした。
そこで質問したいのですが色なしにする理由というのはバックグラウンドが白のままだとセルの枠が見えなくなるからでしょうか。
もしそうであれば設定により枠をつけることができますのでそちらの方を試して頂けたらと思います。
方法としましては同じExcel Set Cell Color and Border.viを使い設定します。
アイコンの上部にピンク色のピンが2つあるかと思いますがそちらからセル内側の線、外側の線を設定できます。
添付した画像を参照して下さい。
画像のように設定しますとセルに黒色の枠ができると思います。
数値設定などに関しても質問されていますが、そちらはヘルプがありますのでそちらを参照頂けると詳しい情報がわかるかと思います。
LabVIEWでVIを開いている時に ctrl + H を押しますと小さいウィンドウ「詳細ヘルプ」が立ち上がります、その状態でマウスのポインタをアイコンに重ねて頂きますと詳細ヘルプにアイコンの説明が記述されます。
ウィンドウズ内のリンクからオンラインヘルプを参照することもできます。
上記内容をご確認いただきまして、何かS_YN様の意図と違う点などありましたらご連絡下さい。
宜しくお願い致します。
日本ナショナルインスツルメンツ株式会社
技術部
湧川 朝満
添付:
Excle Set Color Sample.JPG 58 KB -
Cell Coloring using DAX in SSAS Tabular Model
HI All,
I need to implement background and foreground cell coloring in SSAS Tabular Model using DAX or any other feasible solution similar to what Cell Properties does with MDX which is supported by SSAS Cubes.
Request the gurus to help me with this problem.
Thanks
ETHi Et,
As Marco said, this feature is not supported in current version. If you have any concern about this behavior, you can submit a feedback at
http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that
they can be, Microsoft might consider to add this feature in the following release after official confirmation.
Thank you for your understanding.
Regards,
Charlie Liao
TechNet Community Support -
Problem when setting JTable cell color.
hello,
when I setting color for particular table cell, it sets.
but, when I click another row (another cell) , the color of the previous cell disabled and it visible only when I click that cells row.
how can I permanatly set the color for the rows depends on input data.
for example,
if a device is connected, I want to give the cell color GREEN.
if device is not connected , i want to give the color as RED.
thank you.but, when I click another row (another cell) , the color of the previous cell disabled and it visible only when I click that cells row.It appears you applied color to cell editor.
tableObj.getComponentAt(x,y).setForeground(Color.red);
tableObj.getComponentAt(x,y).setBackground(Color.red); or could be solved properl if you post the code -
Hello,
I am using the ALV OO for the display.
I need to color a particular cell.
How can i do it ?
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'gt_STRUCT'
I_SAVE = X_SAVE
I_DEFAULT = LV_DEF
IS_LAYOUT = LS_LAYOUT
CHANGING
IT_OUTTAB = GT_BPSTAB[]
IT_FIELDCATALOG = GT_FIELDCATALOG[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4Hello,
Check this example,it may help u.
report z_example.
tables : mara.
Type
types : begin of ty_mara,
matnr like mara-matnr,
matkl like mara-matkl,
counter(4) type n,
free_text(15) type c,
color_line(4) type c, " Line color
color_cell type lvc_t_scol, " Cell color
end of ty_mara.
Structures
data : wa_mara type ty_mara,
wa_fieldcat type lvc_s_fcat,
is_layout type lvc_s_layo,
wa_color type lvc_s_scol.
Internal table
data : it_mara type standard table of ty_mara,
it_fieldcat type standard table of lvc_s_fcat,
it_color type table of lvc_s_scol.
Variables
data : okcode like sy-ucomm,
w_alv_grid type ref to cl_gui_alv_grid,
w_docking_container type ref to cl_gui_docking_container.
parameters : p_column as checkbox,
p_line as checkbox,
p_cell as checkbox.
at selection-screen output.
perform get_data.
perform fill_catalog.
if w_docking_container is initial.
perform create_objects.
endif.
*& Form create_objects
form create_objects.
create object w_docking_container
exporting
ratio = 60
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
create object w_alv_grid
exporting
i_parent = w_docking_container.
Field that identify color line in internal table
move 'COLOR_LINE' to is_layout-info_fname.
Field that identify cell color in inetrnal table
move 'COLOR_CELL' to is_layout-ctab_fname.
call method w_alv_grid->set_table_for_first_display
exporting
is_layout = is_layout
changing
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endform.
*& Form get_data
form get_data.
select * from mara up to 5 rows.
clear : wa_mara-color_line, wa_mara-color_cell.
move-corresponding mara to wa_mara.
add 1 to wa_mara-counter.
move 'Blabla' to wa_mara-free_text.
if wa_mara-counter = '0002'
and p_line = 'X'.
Color line
move 'C410' to wa_mara-color_line.
elseif wa_mara-counter = '0004'
and p_cell = 'X'.
Color cell
move 'FREE_TEXT' to wa_color-fname.
move '6' to wa_color-color-col.
move '1' to wa_color-color-int.
move '1' to wa_color-color-inv.
append wa_color to it_color.
wa_mara-color_cell[] = it_color[].
endif.
append wa_mara to it_mara.
endselect.
endform.
*& Form fill_catalog
form fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
data : w_position type i value '1'.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATNR' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATNR' to wa_fieldcat-ref_field.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATKL' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATKL' to wa_fieldcat-ref_field.
Color column
if p_column = 'X'.
move 'C610' to wa_fieldcat-emphasize.
endif.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'COUNTER' to wa_fieldcat-fieldname.
move 'N' to wa_fieldcat-inttype.
move '4' to wa_fieldcat-intlen.
move 'Counter' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'FREE_TEXT' to wa_fieldcat-fieldname.
move 'C' to wa_fieldcat-inttype.
move '20' to wa_fieldcat-intlen.
move 'Text' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
endform.
Regards -
DataGrid: Modify Foreground Cell Color A Based on Content Of Cell B - Is it possible?
Hi there!
In this forum we can found two nice thread about datagrid format:
Modifying background color of datagrid based on data in grid
Change the RowBackground Color of Datagrid
You can also find a great example here:
LightSwitch control colors of DataGrid rows and other UI elements
All the examples are about Format Cell A based on its content. A need an example where Cell A are formated based on Cell B content.
Is it possible do it?
Best regards,
CiroHi!
Have you any success in implementing row/cell coloring?
Maybe I'll sound little pessimistic, but I just lost 3 days getting something similar to work.. LS is just not up to task.. Now I'm not surprised that it went on the road it went (abandoned).. While the idea is great, everything else is just -> meh..
(and i'm here all the way from beta 1)..
I have simple "is_active" computed property (but I feel it's the same with properties from related tables) and need to color rows accordingly: green - active, red - inactive.. It works inconsistently.. If you have some complex screen you need to
find hook points where you could inject methods to tell datagrid to refresh layout (like "datagrid.OnApplyTemplate"), or just "collection.refresh()".. On every screen I used it there is some "catch".. I've
tried almost everything I could find on net, Dave's example(s), Otis example, some already aged similar SL posts.. tried to connect tables in various combination
like 0..1 -> 1.. I have even converted my tables logic to RIA services where main table does not have computed properties but whole table is returned with "real" properties from RIA service (so "is_active" is computed before arriving
to client).. Still same stupidities, inconsistency, "loading_row" not being fired, not to mention troubles in plumbing all together between RIA tables and "real" tables...
Something so "simple" shouldn't be so complicated to achieve.. If anyone have (kind of) solution I'd like to hear/read it cause right now this "LS thing" have big chance to fly trough my window together with my pc..
Kivito
Nobody expects the Spanish Inquisition! (M.P.F.C.)
Maybe you are looking for
-
Hi, I made an upgrade from Windows XP ti Windows 7 on my T400. Also I updated my BIOS from 2.x to 3.01 and the firmware of the harddrive. Windows 7 is nice, but sound wasn´t working. I watched several forums and installed dozens of Conexant drivers.
-
How to transfer photo back to iphone camera roll?
I accidentally click delete after import while importing photo from iPhone to iPhoto. All photos in my iPhone's camera roll were gone. I have tried to sync photo back to iPhone but it only created a new folder rather than putting photo back to camera
-
Char Set with Portuguese special characters
Hi all, it's kind of urgent. I need to create a new Output Device (SPAD transaction) with the device type ASCII. Until that, no problem, but I need this device type to allow printing special characters like Ç, ç, â, ä, º, ª, etc. Every special char i
-
I have an iMac with Lion 10.7.4 and tonight I tried to download and install a Maxstor drive from the internet, since then the following notice has appeared on my screen at approximately 6 second intervals. "you can't open application NotificationExe
-
After software update my Nokia E51 has lost intere...
Yesterday I did for the first time my Nokia E51 software update. I followed after instruction, update has installed properly. After update I backed up my phone data and settings. But there is one problem. After update my phone lost internet connectio