combit List & Label 28 - .NET Help
combit.Reporting.DataProviders Namespace / ICanHandleUsedIdentifiers Interface / SetUsedIdentifiers Method
A collection of field and variable names that are used in the project about to be printed.
Example


In This Topic
    SetUsedIdentifiers Method (ICanHandleUsedIdentifiers)
    In This Topic
    This method is called by List & Label to set the identifiers (i.e. variables and field names) used in a project that is about to be printed. You may cache this information in your own data provider in order to e.g. optimize your queries.
    Syntax
    'Declaration
     
    
    Sub SetUsedIdentifiers( _
       ByVal identifiers As ReadOnlyCollection(Of String) _
    ) 
    void SetUsedIdentifiers( 
       ReadOnlyCollection<string> identifiers
    )
    void SetUsedIdentifiers( 
       ReadOnlyCollection<String^>^ identifiers
    ) 

    Parameters

    identifiers
    A collection of field and variable names that are used in the project about to be printed.
    Example
    #region ICanHandleUsedIdentifiers Members
    
    private ReadOnlyCollection<string> _usedIdentifiers;
    internal ReadOnlyCollection<string> UsedIdentifiers
    {
        get
        {
            return _usedIdentifiers;
        }
    }
    
    public void SetUsedIdentifiers(ReadOnlyCollection<string> identifiers)
    {
        _usedIdentifiers = identifiers;
    }
    
    #endregion
    
    ...
    {
        if (!_usedIdentifiers.Contains(fieldName))
        {
            // skip costly processing for fieldName, it is not used at all
            continue;
        }
        ...
    }
    #region ICanHandleUsedIdentifiers Members
    Private _usedIdentifiers As ReadOnlyCollection(Of String)
    Friend Readonly Property UsedIdentifiers() As ReadOnlyCollection(Of String)
        Get
            Return _usedIdentifiers
        End Get
    End Property
    
    Public Sub SetUsedIdentifiers(identifiers As ReadOnlyCollection(Of String))
        _usedIdentifiers = identifiers
    End Sub
    #End Region
    ...
    Public Sub ...
        If Not _usedIdentifiers.Contains(fieldName) Then
            ' skip costly processing for fieldName, it is not used at all 
            Continue
        End If
    End Sub
    Requirements

    See Also