Solved

To shade a row for a particular condition.

Posted on 2006-11-27
8
502 Views
Last Modified: 2013-12-26
PB7:

In a datawindow I have written this expression in every column.
if( diff<>0 , rgb(187,190,198), rgb(255,255,255))   [ written on Backgroun Colour Property ]
Because of this , the complete row is shaded if value of column diff<>0.

Is it possible to have the same effect by writing the above expression at one place only.
0
Comment
Question by:Mateen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 

Author Comment

by:Mateen
ID: 18018441
Please note that, If I write the expression in detail band then it will work in normal mode. It will not work in print preview mode.
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 18026115
Hi,

Ofcourse there is work around !!!!!!!!!.

Put one static text behind all columns and set background property for that static text control. Remember back ground color property for all columns should be 'TRANSPERANT'

Good Luck !!!!!!!

Regards,
Sandeep
0
 

Author Comment

by:Mateen
ID: 18026593
Yes,
Your technique worked even in preview mode.
I have to put static text in [ ALL ] columns.

Is it possible to do the same by doing it at on place ( instead of ALL columns).

Thanks 4 your answer.




0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:sandeep_patel
ID: 18026703
Hey,

why u need to pur static text in all columns.

Can't u put a single long static text which covers all columns  ?

Ofcourse instead of individual column in that row it will display entire row in different color. I mean there won't be any gape inbetween columns. Entire row will be of different color u set. But i think that should not be the problem for user.

Regards,
Sandeep
0
 

Author Comment

by:Mateen
ID: 18026812
I am using grid datawindow.
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
ID: 18026927
Ohhhhhhhhhh,

Ok then another solution......

write a script to set property runtime rather design time.
Script should be written in constructor event for that datawindow like....


long ll_count, ll_col

ll_col = Long(This.Object.datawindow.column.count)

For ll_count = 1 To ll_col
     dw_list.Modify("#"+string(ll_count)+".background.mode = '2'")
     dw_list.Modify("#"+string(ll_count)+".background.color = '553648127~tif( diff<>0 , rgb(187,190,198), rgb(255,255,255))'")
Next

Hope this will work now.

Regards,
Sandeep
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 18026937
sorry,

in above solution 'dw_list' should be replaced with 'This' or your datawindow name.
0
 

Expert Comment

by:BradAndMindy
ID: 23564947
To change the background color of a row based on a given value of a column in that row put a variation of the following in the datawindow's detail band color expression:
if(  code_status ="I",rgb(187,190,198),rgb(255,255,255))
The RGB combinations above will highlight "I"nactive codes with a gray background. Substitute your column and condition value to suit your needs.  
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question