Schultz’s PowerBuilder Notes

Making DW Radio Buttons and Check Boxes look disabled

An effective GUI quickly communicates to the users  how they can interact with the current window.  For most datawindow edit styles, PowerBuilder supplies its developers with the means to visually show if  it is available to accept user input.  Unfortunately, if you are working with an older version of PB,  how to show  a disabled check box or a radio button is a  puzzle.  Here is how I deal with this issue.

Read more »

March 17, 2009 Posted by rick130 | 2. Datawindows, Datawindow PowerScript, Expressions, Modify and Describe | , , , , , , , , , , , | No Comments Yet

Setting the RowStatus

If you have worked with PowerBuilder for a while, you have learned that setting the status of a row is not always a straight forward procedure.  I have created a handy utility which will simplify this process.

Read more »

January 1, 2009 Posted by rick130 | 2. Datawindows, Datawindow PowerScript, Powerscript | , , , , , , , , , , | 4 Comments

Update Status Flags

ItemStatus actually holds two pieces of information at once:

  • New/Not New
  • Modified/Not Modified

Read more »

June 7, 2008 Posted by rick130 | Datawindow PowerScript | , , , , , , | No Comments Yet

DataWindow Script Techniques

How do I set a property for an entire column?

Modify(“shft_id.visible = 0″)

Modify(“shft_desc.protect = 1″)

Read more »

May 26, 2008 Posted by rick130 | 2. Datawindows, Datawindow PowerScript | , , , , , , , , , , , , , , , , , , , , , , , , , , , | 8 Comments

InterDataWindow Communication

RowsCopy

RowsCopy will copy the contents of one datawindow/datastore to another. The RowStatus flags for each row will be NewModified!

Read more »

May 26, 2008 Posted by rick130 | Datawindow PowerScript | , , , , | No Comments Yet

Row Selection

GetSelectedRow(long)

Reports the number of the next highlighted row after a specified row in a DataWindow control or DataStore object. Argument is the row after which you want to search for the next selected row. Specify 0 to begin searching at the first row

Read more »

May 26, 2008 Posted by rick130 | Datawindow PowerScript | , , | No Comments Yet

Printing a DataWindow

Print Events

  • PrintStart
  • PrintPage
  • PrintEnd

In the PrintPage event, a RETURN 1 will skip the next page to be printed.

Read more »

May 25, 2008 Posted by rick130 | Datawindow PowerScript | , , , , , | No Comments Yet

Groups and Grouping

How do I dynamically change a group property?

ll_color = RGB(200, 200, 500)

dw_1.Modify(“DataWindow.Header.2.Color=” + String(ll_color))

dw_1.Modify(“DataWindow.Trailer.2.Height=500″)

Read more »

May 25, 2008 Posted by rick130 | Datawindow PowerScript, Presentation Styles | , , , , , , , , , , , , , , , , , | 4 Comments

Exporting Data

How do I write the contents of a DataWindow or datastore to an ASCII file?

Dw_1.SaveAs(“<file name>”, TEXT!, false) // Last parameter suppresses column headings.

May 25, 2008 Posted by rick130 | Datawindow PowerScript | , , , , | No Comments Yet