PowerBuilder – Simple datawindow column sort by click

Posted on July 1, 2010 at 8:20 pm in

This sample is for sorting the rows in a grid datawindow ascending or descending based on the user clicking the column header. It only allows for a single column sort at a time. //Clicked event of datawindow // You need an instance variable (string is_sort_column) // This script first checks to see if we've clicked…

PowerBuilder – Simple datawindow column sort by click - the full story »

PowerBuilder ‘Gotcha’ – Datawindow XML

Posted on June 30, 2010 at 8:20 pm in

A feature was added to the datawindow as of version 9 which allows you to save the data as XML (you have to define an export template). The syntax is: ls_xml_data_set = dw_1.object.datawindow.data.xml However, if you have a large string column in the datawindow  – something like a CHAR(32000) – and it contains a lot…

PowerBuilder ‘Gotcha’ – Datawindow XML - the full story »

PowerBuilder ‘Gotcha’ – Autosize Height and strings (wordwrap doesn’t work)

Posted on June 25, 2010 at 8:20 pm in

So I have a datawindow which displays some information in rows about invoices for a customer. There is a ‘notes’ column which contains whatever the salesperson entered at the time of the order. Generally you would want to make sure the column in the datawindow for these notes is flagged with the autosize height property…

PowerBuilder ‘Gotcha’ – Autosize Height and strings (wordwrap doesn’t work) - the full story »

Frogpond – A Child’s Game

Posted on June 22, 2010 at 8:20 pm in

I created this simple game in PowerBuilder as an intellectual exercise as well as to give to my kids.  This first version is very basic – you move the frog around to eat the flies. I plan on enhancing it as time permits. Instructions are included in a text file included in the Zip archive.…

Frogpond – A Child’s Game - the full story »

PowerBuilder ‘Gotcha’ – pbm_dwnmousemove

Posted on June 22, 2010 at 8:20 pm in

If you are using ancestry in your application (and who doesn’t unless it’s really, really, really simple) verify that there isn’t an event mapped to pbm_dwnmousemove (or any other event ID for that matter).  If there is an ancestor event mapped to this and it has no code you will be able to create a…

PowerBuilder ‘Gotcha’ – pbm_dwnmousemove - the full story »

PowerBuilder – Lookup the Display value of a DDDW column

Posted on June 17, 2010 at 8:20 pm in

It’s a pretty typical situation where you want to know the value displayed in a dropdown datawindow even though behind the scenes only the ID is saved.  Here is a technique you can use to look up the value in any row in the datawindow. ls_describe = “Evaluate(‘LookUpDisplay(part_id)’, ” + string(ll_found) + “)”//ll_found is the…

PowerBuilder – Lookup the Display value of a DDDW column - the full story »

Comment on PowerBuilder – Lookup the Display value of a DDDW column »

PowerBuilder – Change Background of Modified Columns in Datawindow

Posted on June 17, 2010 at 8:20 pm in

Okay so you have a datawindow with a bunch of rows which can be edited (a grid datawindow is a good choice).  So when the user pulls up the data set and proceeds to change values in a variety of columns and a variety of rows you want to indicate to him that the specific…

PowerBuilder – Change Background of Modified Columns in Datawindow - the full story »

PowerBuilder – Simple ‘Windows Standard’ Row Selection

Posted on May 21, 2010 at 8:20 pm in

Allowing for ‘Windows Standard’ muli row selection is pretty straight forward.  By ‘Windows Standard’ I mean you can select a range by clicking on a row, holding the shift key and clicking on a second row to select all the rows between the two or by holding down the control key and clicking you can…

PowerBuilder – Simple ‘Windows Standard’ Row Selection - the full story »

PowerBuilder – Watch expressions in Debug

Posted on April 13, 2010 at 8:20 pm in

There is an easy way to see the contents of a datawindow/datastore while in debug mode – through the use of watch expressions.  Once you are stopped at a breakpoint, say after a retrieve, insert the following watch expression:dwname.saveas(“c:\temp\dwname.xls”,xls!,true)The watch window should show a “1” indicating the successful execution of the expression.  Open up the…

PowerBuilder – Watch expressions in Debug - the full story »

Powerbuilder – Evaluating Arithmetic Expressions

Posted on March 11, 2010 at 8:22 pm in

Below is a function which allows the user to enter an arithmetic expression and then evaluate it and return the result.  This will work for addition (+), subtraction(-), multiplication(*), division(/), and exponentiation(^).   You can also enter parenthesis to change the order of precedence if needed.  You would call this from where ever you like to…

Powerbuilder – Evaluating Arithmetic Expressions - the full story »

Top