combit List & Label 24 - .NET Online Web Help
Suppress Data From a Data Source
Programming Introduction > Examples > General > Database Independent Contents > Suppress Data From a Data Source

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
    LL.Design();

    // Print
    LL.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
    LL.Design()

    ' Print
    LL.Print()
End Using