Mapping relational data structures in List & Label

Data source: Working with .NET data providers

When a List & Label data provider is used in .NET, the data structure (including the necessary relations) is always read automatically. A wide range of different data providers for a variety of data sources are already included - see also combit. Reporting.DataProviders Namespace. Here are a few examples:

  • With the ObjectDataProvider, the relationships are mapped in such a way that a property is simply defined as a list in the main object, resulting in a Master > Detail relationship.

  • If the SqlConnectionDataProvider is used, the relational structure is automatically read and processed via the SchemaInfo in the database.

  • If, on the other hand, you use the DbCommandSetDataProvider because you want to define individual commands (each command is a separate table) without having to query the entire database, this can be implemented using AddRelation.

  • Alternatively, it is possible to write your own data provider in .NET. This is done using the Interface IDataprovider.

Controlling the data model

List & Label distinguishes between fields and variables, which affects their use and validity in a report. Details can also be found under Variables, fields and data types.

By default, data from the data structures of the data provider used is always defined as tables with fields. However, in order for header data to be used as variables (Master) and item data as tables with fields (Details), the List & Label object used requires additional information.

Which table in the registered data model is the main table (Master) and should be registered for the header data/variables? This can be controlled using the two properties AutoMasterMode and DataMember (Master); the tables that are relationally linked to them are then automatically registered as tables with fields:

LL.AutoMasterMode = LlAutoMasterMode.AsVariables;
LL.DataMember = "Customers";

Further examples

The List & Label installation provides various programming examples for this purpose. Among other things, the example DataBinding Sample 2 under \Samples\Microsoft .NET\... shows how to control the data model with AutoMasterMode and DataMember.