PowerBuilder - About Datawindow Report

Can somebody teach me how to highlight a row automatically without user clicking on it? I am supposed to create a datawindow report of invoices. It's like this, the row where the order quantity is equal or larger than 1000, will be highlighted in red color. Which object do i need to put the script in, and which under which event?

Thanks in advance.

LVL 2
sherlyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

david_levineCommented:
By highlight a row, do you mean set the text in the row to red? If so, here's the easiest way:

Open the datawindow in the datawindow painter. Double click on each column that you want to change the color to red. Select the Expressions tab in the properties window that opens. In the Color column, enter something like:

if( ord_qty > 999, rgb(255, 0 ,0), rgb(255, 255, 255))

Let me know if that'll work and I'll re-submit as an answer.

David
0
sherlyAuthor Commented:
Thanks for your idea. But what I want to do is HIGHLIGHT the row. It's like the usual user click on that particular row(like select row). The whole row will be higlighted by a blue bar. What I want is don't need a user to click on it but automatically highlight the row will meet the criteria in RED color bar.
0
david_levineCommented:
In the datawindow painter for the datawindow you want to change, right click over the Detail band and select Properties from the popup menu. Click the Expressions tab in the window and specify the expression I listed above as the color property. You might need to check the background colors on each of your fields in the detail band and set their background color to transparent (last "color" in the drop-down list).

David
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sherlyAuthor Commented:
Thank you very much! May I know is this the only way? Anyway, I am able to solve the problem now, thanks for your help!


0
david_levineCommented:
Is this the only way? Probably not. There are usually a bunch of ways to solve any one problem. For this particular problem I've also seen a solution posted that uses a rectangle (sent to back) where the color of the rectangle is set based on a condition like the one you want. I don't see any advantage to do that and I think the way I described is a "more elegant" solution.

David
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.