DataSourcePrint

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber DataSourcePrint( SalNumber nWhat, SalNumber nParam )

Applications and the framework call the DataSourcePrint method to print the information in a data source.

Parameters

Name Description
SalNumber nWhat Standard method parameter. Possible values are Const.METHOD_Inquire, Const.METHOD_Execute, Const.METHOD_GetType.
SalNumber nParam Unused. The framework ignores the value of this parameter.

Returns

When nWhat = Const.METHOD_Inquire: the return value is TRUE if the data source can be printed, FALSE otherwise.

When nWhat = Const.METHOD_Execute: the return value is TRUE if the data source was successfully printed, FALSE otherwise.

When nWhat = Const.METHOD_GetType, the return value is Const.CHILDTYPE_SourceMethod.

Comments

The framework provides an implementation of DataSourcePrint that prints the table contents for table data sources, and forwards the print request to the logical parent for other data sources.

Applications may override the DataSourcePrint method to perform some other operation, e.g. ordering an Info Services report.

DataSourcePrint is called automatically by the framework when a data source receives the Const.PM_RequestForPrint message.

Example

needs C# coding. But seems the method just returns the _cDataSource.DataSourcePrint(nWhat, nParam);

Function: DataSourcePrint
Description:
Actions
   Select Case nWhat
      Case METHOD_Inquire
         Return SalTblAnyRows( i_hWndFrame, ROW_Selected, 0 )
      Case METHOD_GetType
         Return CHILDTYPE_SourceMethod
      Case METHOD_Execute
         Set nRow = TBL_MinRow
         Set nContext = SalTblQueryContext( i_hWndSelf )
         While SalTblFindNextRow( i_hWndSelf, nRow, ROW_Selected, 0 )
            Call SalTblSetContext( i_hWndSelf, nRow )
            Call PalAttrAddNumber('RESULT_KEY', i_hWndSelf.colResultKey, lsInstanceAttr[i])
            Set i = i + 1
            Call SalTblSetContext( i_hWndSelf, nContext )
            Call PalAttrAdd('OUTPUT', 'DIALOG', lsPrintAttr )
            Return InfoService.ReportListPrint( lsPrintAttr, lsInstanceAttr )