Tuesday 25 October 2016

4. DataWindows : Strength of Powerbuilder


Datawindow is a control used in powerbuilder for displaying data on the form.  Now this data could be updated, deleted  or a new entry can be inserted. Validations can be put while inserting rows.

Types of data sources that can be linked to data window controls:
  •         Quick Select – Used when data comes from one or more tables linked by a foreign key.
  •         SQL Select – In addition to above grouping & computed columns can be specified
  •         External – the data can be imported from a flat file or populated from the code.
  •         Query – used when the data source (SQL statement) is saved in a query object defined in the query painter.
  •         Stored Procedure




This could be used to extract ,insert, update Date in Table very efficiently.  We create Data-window specifying the :

  • Type of Data-window need : Grid, Tabular, Freeform, etc
           
  • Table/s & Columns and own columns evaluated on columns or having arbitrary values for all rows.









  • Specify where clause if needed . We can create it using SQL query or design using UI. For specifying dynamic filter to this datawindow, we need to Add Retrieval Argument. 
     
                   

We can specify display formats, presentation styles, and other data properties to make the data meaningful to users.


Adding Datawindow Control to window.


Code for operations on Datawindow control dw_1 


To set datawindow d1 to datawindow control:
dw_1.dataobject='d1';

To retrieve Datawindow control rows:
dw_1.retrieve( );

Retrieve giving parameters need to retrieve:
dw_1.retrieve( arg1,arg2,arg3, arg4, . . .);

To delete current row:
dw_1.deleterow(dw_1.getrow( ));

To insert row:
dw_1.insertrow( row);
where row is before which you want to insert a row.To insert a row at end,specify 0.

To update all changes  made in datawindow (insertion,deletion,updation)  to  Db:
dw_1.update()
before this update operation


For updating rows at db, Powerbuilder need update clause ;
 for this we need to configure update on datawindow for the table to be updated,














Datawindow dynamic capabilities is beyond the limits of mentioning it here . Datawindow  It would benefit to explore to use best of datawindow using properties of columns

  •  Visibility & color ( Background / foreground)
  •  Alignment, Size of columns & gap b/w rows.
  •  property setting using datawindow expression.
  •  Changing column to be of drop-down capability using other datawindow column 
  •  Inserting computed columns on the available columns .




1 comment:

  1. greetings, visit https://zulmach.wordpress.com/ download installer and other resources such as modern ui framework

    ReplyDelete