GetOldSelectionFormula Function

Applies To  

Retrieves the selection formula currently being used by the report being processed.

Syntax
GetOldSelectionFormula(
    ISELECTIONFORMULA_HANDLE i_hISelectionFormula, 
    int* io_selectionFormulaSize, 
    Char* o_selectionFormula)
Parameters

i_hISelectionFormula [In]

The handle to the ISelectionInfoFormula interface. See hISelectionFormula Variable.

io_selectionFormulaSize [In, Out]

The size of your buffer. The size is a combination of the selection formulas that have previously been specified in the report, by the user (if the report is being viewed on demand), or through the Crystal Management Console (CMC).

o_selectionFormula [Out]

The record selection formula that is currently being used in the report or subreport. This is considered to be the "old" selection formula.

Returns

Each function returns a RET_VALUE that is an error code of type Long. The return value is greater than zero if the call was successful, and zero or less if not. Use RET_OK(x) and RET_ERROR(x) to check for failure.

If the function call fails, check the value of the buffer size parameter. After a successful function call, this parameter contains the size of the buffer that you passed in. However, if the buffer size is too small, then the function returns PROCESSEXTERR_BUFFERSIZETOOSMALL, and the buffer size that is needed is specified in the parameter.

Remarks

What is retrieved by the GetOldSelectionFormula function depends on whether or not the report is the main report or a subreport. If the o_isSubReport parameter (see GetReportTitle Function) is False, then the function retrieves the selection formula that has already been set for the main report. If o_isSubReport is True, then it retrieves the old selection formula for the subreport.

A new selection formula can be specified with the SetSelectionFormula Function. This function appends a new filter string to the old selection formula.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com