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.
Const.PM_RequestForPrint
The Const.PM_RequestForPrint message is sent to a date source when the user requests a print (e.g. by clicking the print button in the toolbar).
Name | Description |
---|---|
nWhat = wParam | Standard method parameter. Possible values are Const.METHOD_Inquire, Const.METHOD_Execute, Const.METHOD_GetType |
lParam | Unused |
When nWhat = Const.METHOD_Inquire, the return value is TRUE printing is available, FALSE otherwise.
When nWhat = Const.METHOD_Execute, the return value is TRUE if the object printed successfully, FALSE otherwise.
The framework provides default processing of the Const.PM_RequestForPrint message by calling the DataSourcePrint method. For single-record windows this method will not do anything, but for table objects, this method will print the table contents.
This example traps the PM_RequestForPrint message to bring up the Info Services report print dialog for the selected items instead of just printing the table contents (which is the default behavior).
On PM_RequestForPrint Select Case nWhat Case METHOD_Inquire Return SalTblAnyRows( i_hWndFrame, ROW_Selected, 0 ) Case METHOD_GetType Return CHILDTYPE_AnyMethod 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 ) Set lsInstanceAttr[i] = InfoService.ItemValueCreate( 'RESULT_KEY', SalNumberToStrX( i_hWndSelf.colResultKey, 0 ) ) Set i = i + 1 Call SalTblSetContext( i_hWndSelf, nContext ) Return InfoService.ReportListPrint( InfoService.ItemValueCreate( 'OUTPUT', 'DIALOG' ), lsInstanceAttr )public const int PM_DataSourcePrint = PM_RequestForPrint;private void cDataSource_MessageActions(ref SalMessage message) { #region Actions switch (message.Code) { case Const.PM_RequestForPrint: message.Handled = true; message.Return = this.vrtDataSourcePrint(Sys.wParam, Sys.lParam); return; } public virtual SalNumber vrtDataSourcePrint(SalNumber nWhat, SalNumber nParam) { LateBind lateBind = (LateBind)this._derived; if (lateBind == null) { return this.DataSourcePrint(nWhat, nParam); } else { return lateBind.vrtDataSourcePrint(nWhat, nParam); } } public SalNumber DataSourcePrint(SalNumber nWhat, SalNumber nParam) { #region Actions return SendMessageToParent(Const.PM_RequestForPrint, nWhat, nParam); #endregion }