[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 974
  • Last Modified:

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.

0
sherly
Asked:
sherly
  • 3
  • 2
1 Solution
 
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
 
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now