This bug occurs in version 11.5.1 Build 4608. I’m not sure of other versions at this point. One of the many great features of the datawindow is the ability to create expressions on various object properties. This can greatly reduce coding for ‘eye candy’ type stuff throughout an application. A very common use is to…
You are currently browsing all posts tagged with datawindow
PowerBuilder Bug – Autosize height and font color
PowerBuilder ‘Gotcha’ – Datawindow Find method
The find method on the datawindow is a very useful tool but you should always remember to set the upper limit of the rows to search in excess of the actual rowcount. In simple terms: dw_1.find('part_no = 123', 1, dw_1.rowcount()) Never do this!Instead use: dw_1.find('part_no = 123', 1, dw_1.rowcount() + 1) or simply dw_1.find('part_no =…
PowerBuilder ‘Gotcha’ – Datawindow retrieval arguments
So I’m working on a scheduling process and I have a datawindow object which takes a number of arguments.I have them set up as al_pro_id (long), adt_end (datetime), adt_start (datetime), al_resource_id[] (long array), and al_dept_id (long). To save from maintaining two separate objects, I used this object for a datawindow as well as for datastores…
PowerBuilder ‘Gotcha’ – Datawindow.Create function
I’m working in a custom report application and a tester who is auditing the changes is getting an syntax error when she tries to run her report. The report generator takes the list of columns chosen by the user and builds a SQL statement which is then fed through the SyntaxFromSQL function to generate the…
PowerBuilder ‘Gotcha’ – dddw Edit Type
Be careful when you change the columns in a datawindow object referenced in another datawindow object when using the DropDownDatawindow Edit Type. If you change the column name which is referenced in the DDDW Edit Type of another you won’t get a compile error when saving – but you will get runtime errors. This happened…
PowerBuilder – Simple datawindow column sort by click
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 ‘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…
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…