Solved

To shade a row for a particular condition.

Posted on 2006-11-27
8
485 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
  • 4
  • 3
8 Comments
 

Author Comment

by:Mateen
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 14

Expert Comment

by:sandeep_patel
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Mateen
Comment Utility
I am using grid datawindow.
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
Comment Utility
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
Comment Utility
sorry,

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

Expert Comment

by:BradAndMindy
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now