Datawindow Syntax Generator

Last Updated 6th Jan 1998 
Send me your comments EMail your comments to me
 

 
 
Click here to download n_cst_dwgen and sample application: 
dwgbeta.zip, 61kb, PB5 
 
n_cst_dwgen is a NVO which allows developers to dynamically create Datawindow syntax without using SyntaxFromSQL. What this means is that you can create Datawindows which cannot be based on SQL. The .zip file also contains a sample application which demonstrates how to use n_cst_dwgen. 

The sample application - Questionnaire, allows the user to dynamically define questionnaire forms and save them to a .PBL file.

 

Some Background

Recently, while developing a proof-of-concepts system I came across the need to dynamically create datawindows. Simple, you say. Just use SyntaxFromSQL. Fine, but what if the datawindow to be generated can not be based on SQL? What I wanted to do was generate forms on the fly, allow the user to input data and then save the data back to the database in very different form than what the user saw. A bit like - 'turning rows into columns'. I know that pulled out of context, this requirement does seem weird, but it was very much necessary.

Strategy

The fundamental problem is that PowerBuilder does not provide any means to dynamically create Datawindows which are not based on SQL. One can create column objects at run time using CREATE in Modify but the column must be defined in the datawindow result set. So the primary objective in developing n_cst_dwgen was to develop the ability to generate the minimum syntax with the required result set definition. However n_cst_dwgen does provide more than just the minimum syntax. It can generate column header / lables and lays out the Datawindow in Tabular, Grid or FreeForm style.

How It Works

n_cst_dwgen takes the columns and datatypes as parameters and constructs the datawindow syntax from scratch. See the article Dissecting The Datawindow to understand the datawindow object syntax.


Back to my HomePage
  1