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.

ListLabel LL = new ListLabel();
LL.DataSource = CreateDataSet();

 

// Add event handling for suppressing fields

LL.AutoDefineField += new AutoDefineElementHandler(LL_AutoDefineField);


// Call Designer
LL.Design();

 

// Print

LL.Print();

LL.Dispose();

 

 

void LL_AutoDefineField(object sender, AutoDefineElementEventArgs e)

{

    if (e.Name.EndsWith("ID"))

        e.Suppress = true;

}