SetSelectionFormula Function

Applies To  

Sets the report's record selection formula.

Syntax
SetSelectionFormula(
    ISELECTIONFORMULA_HANDLE i_hISelectionFormula,
    ConstChar* i_selectionFormula)
Parameters

i_hISelectionFormula [In]

The handle to the ISelectionInfoFormula interface. See hISelectionFormula Variable.

i_selectionFormula [In]

The filter string that will be appended to the current selection formula. The server will concatenate the old selection formula with the new filter string that is passed through i_selectionFormula. It will then send this modified selection formula to the report.

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

You may want the record selection to be applied to all requests, or you may want it to be applied only when a report is being scheduled or viewed. Use the GetRequestType Function to determine the type of request that is being made.

To ensure row-level security at all times, you must apply the processing extension to both view and schedule requests. For example, if you have an employee profile report that uses a selection formula such as sf = {Employee.Last Name}<"M", and you apply the processing extension when scheduling the report, then the returned data will be the last name up to, but not including, "M". However, if the user refreshes the report, and a processing extension is not applied at view time, then the complete set of data (the last names from "A" to "Z") will be retrieved from the database. In other words, if you allow users to refresh and view a scheduled report that uses a processing extension, then if you want to continue to restrict access to report data, you must remember to use the processing extension on view as well as on schedule.



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