User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
PowerBuilder 2017R3 generate PDFs with advanced features from within your app using smile native PowerBuilder APIs. There is no need to go through cumbersome PDF printer installations or license expensive PDF libraries. You can control the PDF conformance level, page orientation & size, image properties, and much more.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

We create a small datastore and use it to sort our array.

 

datastore lds_temp
string ls_err
integer i

// change the datastore definition according to the array data type
long ll_array[] = { 2 , 3, 6, 5 }
string ls_dsdef = &
   'release 6; datawindow() table(column=(type=long name=a dbname="a") )'

lds_temp = CREATE datastore
lds_temp.Create(ls_dsdef, ls_err)
// put the array in the datastore
lds_temp.object.a.current = ll_array
lds_temp.SetSort("a ASC")
lds_temp.Sort()
// get back the array
ll_array = lds_temp.object.a.current

FOR i = 1 to Upperbound(ll_array)
  MessageBox("", string(ll_array[i]))
NEXT

DESTROY lds_temp


Original in: http://www.rgagnon.com/
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Place a rectangle with a transparent background color. Place fields on the rectangle. In the expression tab for the rectangle, in the backgound color field :

 

if ( mod(getrow(),2) = 0, oneColor, anotherColor )


Original Autor: http://www.rgagnon.com/

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

First, define a user event to correspond with the pbm_dwnprocessenter event on a datawindow. Then in that event :

Send(Handle(this),256,9,Long(0,0))
RETURN 1


Original Autor: http://www.rgagnon.com/

User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive

This article describes how to click on the header of a datawindow, allows the datawindow to be ordered by that column. The name of the column header must have the same name as in the database and finish in _t

For example:

Column name: emp_id
Header name: emp_id_t

 

You can only sort by one column at a time.

 

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

This tip was submitted by This email address is being protected from spambots. You need JavaScript enabled to view it..

Here is a clever datawindow trick which determines if there are duplicate rows in the datawindow before saving to the database. In the example below, the unique key in the database is "user_id", so what we are doing here is sorting them and then filtering in a way which leaves only the duplicate rows. If the row count is greater than zero after the sort, there is a problem... no looping necessary!