| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Advanced PowerBuilder
Creating DataWindows DynamicallyPowerBuilder allows you to create a DataWindow dynamically at execution time by using Create() function. For example, say, you display a list of columns to the user and let him pick the ones he want to see in the report. In such a case, at painting time, you will not know anything about the appearance of the finished DataWindow. When having a DataWindow or the custom user object control on your window, you need to complete the three steps involved in the dynamic creation of a DataWindow, in your script:
You can then set the transaction Object and retrieve the data as normal. The reason we call SyntaxFromSQL()is, that the syntax for a DataWindow is different from the SELECT statement; it also contains the column attributes such as font details, colors and so on, as well as other attributes such as band details. A sample of a DataWindow's syntax is shown below:
As an example, the following script creates a grid style DataWindow and retrieves data from product_master: String lSQLStr, lErrorStr, ldwSyntax
Integer lResult
lSQLStr = "select product_no,product_description,product_balance"+ &
" from product_master"
ldwSyntax = SQLCA.SyntaxFromSQL( lSQLStr, "style &
(type=grid)",lErrorStr )
lResult = dwc_1.Create( ldwSyntax, lErrorStr )
dwc_1.SetTransObject( SQLCA )
dwc_1.Retrieve()
SyntaxFromSQL() takes three parameters: a SELECT statement, a style and a string variable to populate any error information. The style attribute is the most complex parameter. The syntax is as follows: "Style(Type=value attribute=value ...) &
DataWindow(attribute=value ...) &
Column(attribute=value ...) &
Group(groupby_col1 groupby_col2 ... attribute ...) &
Text(attribute=value ...) &
Title('titlestring') "
Tabular DataWindow style is the default, and to assume the default values, simply specify an empty string as the parameter.
Again, the simplest way to create this syntax is to use DW Syntax with the Create option. This results in the CREATE statement being pasted directly into the code.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |