You are currently browsing the Programming category

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 – 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 »

PowerBuilder – Populate a dropdownlistbox from a SQL statement

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

Here is a method to populate a dropdownlistbox control with values from a sql statement.  Since it is based on a datastore you can easily apply filters, sorts, etc. prior to populating the dropdownlistbox with values.  The code assumes the first column in the SQL is going to be used to populate the dropdownlistbox .…

PowerBuilder – Populate a dropdownlistbox from a SQL statement - the full story »

PowerBuilder – ‘Smart’ Crosstab Datawindow

Posted on March 4, 2010 at 8:20 pm in

I had a question from a co-worker regarding a functionality request from a user. Basically they wanted a datawindow to display information for vendors (basic stuff like name, amt 1, amt 2, amt 3, etc.) for a specific set of amount columns. Each line represents one vendor and the various amounts (if any) with a…

PowerBuilder – ‘Smart’ Crosstab Datawindow - the full story »

Look what I found

Posted on October 9, 2009 at 12:10 pm in

Work long enough as a programmer and you will no doubt find something in the source code which is a) unintelligible b) ridiculous c) very funny. This category is devoted to these things. Found in a stored procedure: {lots of stuff went on before this point} —- Begin Actual code —- commit; –We will probably…

Look what I found - the full story »

Create Word Doc and attach to Outlook Email in PowerBuilder

Posted on September 23, 2009 at 10:47 am in

Here is some sample PowerScript from back in 2004. The word document created is saved from a template doc previously created with specific bookmarks used to format the text. oleobject lole_word OLEObject lole_item, lole_attach, lole_outlook string ls_file_name lole_word = CREATE oleobject lole_outlook = Create OLEObject TRY lole_word.connecttonewobject('word.application') CATCH (runtimeerror a) Messagebox('Error','Error connecting with MS Word.…

Create Word Doc and attach to Outlook Email in PowerBuilder - the full story »

Top