|
of_addcolumns
|
|
Full name
|
pfc_u_lv.of_addcolumns
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_addcolumns()
|
Name
|
Datatype
|
li_Cnt
|
Integer
|
li_Cols
|
Integer
|
li_NumObj
|
Integer
|
ls_Columns
|
String[]
|
public function integer of_addcolumns ();//////////////////////////////////////////////////////////////////////////////
//
// Function: of_AddColumns
//
// Access: public
//
// Arguments: None.
//
// Returns: Integer
// The number of columns add if successfull, -1 if an error occurred
//
// Description: Add a column to the ListView control for each visible column in the DataWindow.
// They will be displayed in Report View only.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_NumObj, li_Cnt, li_Cols
String ls_Columns[]
// Get all the visible objects in the DataWindow
li_NumObj = ids_Source.inv_base.of_GetObjects(ls_Columns, "*", "*", True)
// Add each column to the ListView
For li_Cnt = 1 To li_NumObj
// Only add objects that are columns or computed fields
If ids_Source.Describe(ls_Columns[li_Cnt] + ".Type") = "column" Or &
ids_Source.Describe(ls_Columns[li_Cnt] + ".Type") = "compute" Then
li_Cols++
If of_AddColumn(ls_Columns[li_Cnt]) < 0 Then Return -1
End If
Next
Return li_Cols
end function