ComponentOne Query 8.0
Specifying Function and Comparison Attributes for a Particular Query Item

To gain even more control over custom functions and comparisons, you can specify all function and comparison attributes on a per item basis, using the following QueryItem properties: ComparisonAttributes and ComparisonTemplate for comparisons and FunctionAttributes, FunctionTemplate for functions.

In this case, the custom function or comparison operator does not have to be defined in templates and does not have to be given any specific Id. Each item can have its own comparison attributes: Caption, Text, Enabled and Template - see Custom Functions and Custom Comparison Operators.

Set C1QueryFrame.Item.ComparisonAttributes (or FunctionAttributes) to a string formatted as a comparison (or function) definition, with the attributes described in Custom Functions and Custom Comparison Operators.

Especially useful is setting the Template attribute for an item's comparison or function, which is usually done in the SQLGenerationItem event, for more information see Changing Query Items for the Duration of SQL Generation. This way you can specify the conditions and expressions that are generated in the SQL statement for every particular item. To do that, set the ComparisonTemplate (or FunctionTemplate) property, which is a shortcut to the ComparisonAttributes (FunctionAttributes) Template attribute.

Setting the QueryItem.Comparison (Function) property resets the item's custom comparison (function) attributes to empty string so that default attributes of the newly assigned comparison (function) take effect.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback