of_RegisterReportColumn


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   of_RegisterReportColumn   

Full name pfc_n_cst_lvsrv_datasource.of_RegisterReportColumn
Access public
Extend of integer
Return value integer
Prototype public function integer of_RegisterReportColumn(n_ds)

Name Datatype
No Data

Name Datatype
li_Cnt Integer
li_Cols Integer
li_NumObj Integer
ls_Columns string[]

public function integer of_RegisterReportColumn (n_ds ads_obj);//////////////////////////////////////////////////////////////////////////////
//	Public Function:	of_RegisterReportColumn
//	Arguments:		ads_obj		The datastore which holds the column information to add to the listview
//	Returns:			Integer
//						The number of columns added if successful
//						-1 if an error occurred
//	Description:	Add a column to the ListView control for all visible columns in
//						the Datastore.  They will be displayed in Report View only.
//						This function overloads the of_RegisterReportColumn function to allow 
//						the last 4 arguments to be optional.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.0   Initial version
//////////////////////////////////////////////////////////////////////////////
//	Copyright © 1996-1999 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[]

// Validate required reference.
if IsNull(ads_obj) or not IsValid(ads_obj) then return -1
if IsNull(ads_obj.inv_base) or not IsValid(ads_obj.inv_base) then return -1

// Get all the visible objects in the DataWindow
li_NumObj = ads_obj.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 ads_obj.Describe(ls_Columns[li_Cnt] + ".Type") = "column" or &
		ads_obj.Describe(ls_Columns[li_Cnt] + ".Type") = "compute" then

		li_Cols++
		if of_RegisterReportColumn(ads_obj, ls_Columns[li_Cnt]) < 0 then return -1
	end if
Next

return li_Cols
end function

     
Name Owner
pfc_n_cst_lvsrv_datasource.of_RegisterReportColumn pfc_n_cst_lvsrv_datasource

     
Name Owner
datastore.describe datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_lvsrv_datasource.of_RegisterReportColumn pfc_n_cst_lvsrv_datasource
pfc_n_cst_dssrv.of_getobjects pfc_n_cst_dssrv

     
Full name
No Data

     
Name Scope
No Data