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…
- .ics
- .NET
- Active Directory
- C#
- Citrix
- COM
- Connection string
- Dashboard
- datawindow
- debug
- disaster prepardness
- ETL
- EVENTCREATE
- Facsys
- frogs
- games
- MDI
- mySQL
- ODBC
- OLEDB
- Outlook
- parenting
- PB.INI
- pfc
- Powerbuilder
- Powerbuilder OLE
- Powerbuilder Tutorial
- programming
- regasm
- REPORTEVENT
- SCOPE_IDENTITY
- source control
- SQL Anywhere
- SQL Native Client
- SQL Server
- TWAIN
- Uniface
- Visual Basic
- web service
- Windows API
- Windows Event Log
- Windows settings
PowerBuilder – Simple datawindow column sort by click
PowerBuilder ‘Gotcha’ – Datawindow XML
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’ – Autosize Height and strings (wordwrap doesn’t work)
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…
Frogpond – A Child’s Game
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.…
PowerBuilder ‘Gotcha’ – pbm_dwnmousemove
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 – Lookup the Display value of a DDDW column
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…
Comment on PowerBuilder – Lookup the Display value of a DDDW column »
PowerBuilder – Change Background of Modified Columns in Datawindow
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 – Simple ‘Windows Standard’ Row Selection
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 – Watch expressions in Debug
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 – Evaluating Arithmetic Expressions
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…