combit List & Label 29 - .NET Help
Programming Introduction / Examples / General / Database Independent Contents / Suppress Data From a Data Source
In This Topic
    Suppress Data From a Data Source
    In This Topic

    Particular fields or variables that are not needed (e.g. ID fields which aren't required for printing) can be suppressed by using the AutoDefineField and AutoDefineVariable events.

    void LL_AutoDefineField(object sender, AutoDefineElementEventArgs e)
        if (e.Name.EndsWith("ID"))
            e.Suppress = true;
    // ...
    using (ListLabel LL = new ListLabel())
        // Define/Assign data source
        LL.DataSource = CreateDataSet();
        // Add event handling for own fields
        LL.AutoDefineField += new AutoDefineElementHandler(LL_AutoDefineField);
        // Call the Designer
        // Print
    Private Sub LL_AutoDefineField(sender As Object, e As AutoDefineElementEventArgs) Handles LL.AutoDefineField
        If (e.Name.EndsWith("ID")) Then
          e.Suppress = True
        End If
    End Sub
    ' ...
    Using LL As New ListLabel()
        ' Define/Assign data source
        LL.DataSource = CreateDataSet()
        ' Call the Designer
        ' Print
    End Using