Class ListLabel
- Namespace
- combit.Reporting
- Assembly
- combit.ListLabel31.CrossPlatform.dll
Represents the List & Label reporting engine.
public class ListLabel : IDisposable
- Inheritance
-
ListLabel
- Implements
- Inherited Members
Examples
The following example demonstrates how to initialize and use the ListLabel reporting engine:
using DebwinLogger logger = new DebwinLogger(@"c:\logs\debwin4.log", LogLevel.Info);
ListLabel listLabel = new ListLabel
{
Logger = logger,
DataSource = GetNorthwindDataSet(), // Ensure you have a method that returns your DataSet
AutoProjectFile = projectFilePath, // Path to your project file
LicensingInfo = "..." // Your licensing key
};
ExportConfiguration exportConfiguration = new ExportConfiguration(LlExportTarget.Pdf, exportFilePath, projectFilePath);
exportConfiguration.ShowResult = true;
listLabel.Export(exportConfiguration);
Remarks
The ListLabel class provides comprehensive reporting capabilities, including data binding, and export functionality. Key properties include:
Logger– to log messages and errors.DataSource– to assign the data source (for example, one of the data providers in the combit.Reporting.DataProviders namespace) used in the report.AutoProjectFile– the path to the JSON report project file. If you've been working with the classic version before make sure to convert your project files.LicensingInfo– the license key required for the reporting engine. A trial watermark will be printed if this property is not set.
Export to generate output in various formats (e.g. PDF, PNG, SVG).
Constructors
ListLabel()
Initializes a new instance of the ListLabel class.
public ListLabel()
ListLabel(ILogger?, IDataProvider?, IRepository?)
Initializes a new instance of the ListLabel class with the specified logger, data provider, and file repository.
public ListLabel(ILogger? logger, IDataProvider? dataProvider, IRepository? fileRepository)
Parameters
loggerILoggerThe logger to be used for logging messages.
dataProviderIDataProviderThe data provider to be used for the List & Label project.
fileRepositoryIRepositoryThe file repository containing the external files that the List & Label project depends on.
Properties
AutoMasterMode
Gets or sets the auto master mode used by the List & Label engine.
public LlAutoMasterMode AutoMasterMode { get; set; }
Property Value
AutoProjectFile
Gets or sets the project file.
public string? AutoProjectFile { get; set; }
Property Value
DataMember
Gets or sets the data member for the List & Label project.
public string DataMember { get; set; }
Property Value
DataSource
Gets or sets the data source for the List & Label project.
public object? DataSource { get; set; }
Property Value
DesignerFunctions
Gets the list of designer functions.
public IList<DesignerFunction> DesignerFunctions { get; }
Property Value
ExportOptions
Gets and sets the export options.
public ListLabelExportOptions ExportOptions { get; set; }
Property Value
Fields
Gets the collection of fields.
public IdentifierCollection Fields { get; }
Property Value
FileRepository
Gets or sets a container for the external files that a List & Label project depends on.
public IRepository? FileRepository { get; set; }
Property Value
LicensingInfo
Gets or sets the licensing information.
public string LicensingInfo { get; set; }
Property Value
Logger
Gets or sets the logger used for logging messages.
public ILogger Logger { get; set; }
Property Value
TimeZoneInformation
Gets the time zone information that should be applied while processing data.
public TimeZoneInformation TimeZoneInformation { get; }
Property Value
Variables
Gets the collection of variables.
public IdentifierCollection Variables { get; }
Property Value
Methods
Dispose()
Releases all resources used by the ListLabel instance.
public void Dispose()
Dispose(bool)
Disposes managed and unmanaged resources.
protected virtual void Dispose(bool disposing)
Parameters
EvaluateExpression(string)
Evaluates the specified expression and returns the result.
public ExpressionValue EvaluateExpression(string expression)
Parameters
expressionstringThe expression to evaluate.
Returns
- ExpressionValue
The result of the expression evaluation.
Export(ExportConfiguration)
Exports the List & Label project using the specified export configuration.
public void Export(ExportConfiguration exportConfiguration)
Parameters
exportConfigurationExportConfigurationThe export configuration with the desired settings to use.
GetMajorVersion()
Retrieves the major version of the current assembly.
public int GetMajorVersion()
Returns
- int
The major version number of the assembly.
OpenProject(Stream)
Opens a List & Label project from the specified stream.
public ProjectBase? OpenProject(Stream projectStream)
Parameters
projectStreamStreamThe stream containing the project data.
Returns
- ProjectBase
The loaded ProjectBase instance, or
nullif loading fails.
OpenProject(string, LlDomFileMode, LlDomAccessMode, LlProject?)
Opens or creates a List & Label project from a file.
public ProjectBase? OpenProject(string projectFile, LlDomFileMode fileMode, LlDomAccessMode accessMode = LlDomAccessMode.ReadWrite, LlProject? projectType = null)
Parameters
projectFilestringThe path or identifier of the project file to open or create.
fileModeLlDomFileModeSpecifies whether to open, create, or open-or-create the project file.
accessModeLlDomAccessModeDefines the access level (read, write, or read/write) for the project file.
projectTypeLlProject?The type of List & Label project to create if the file does not exist. Must be provided if
fileModeis Create or OpenOrCreate and the file does not exist.
Returns
- ProjectBase
The loaded ProjectBase instance, or
nullif loading fails.
Exceptions
- ArgumentNullException
Thrown if
projectTypeisnullwhen creating a project is required.
SetDataBinding(object)
Sets the data binding with the specified data source.
public void SetDataBinding(object dataSource)
Parameters
dataSourceobjectThe data source to bind to.
SetDataBinding(object, string)
Sets the data binding with the specified data source and data member.
public void SetDataBinding(object dataSource, string dataMember)
Parameters
Events
AutoDefineField
Occurs when a field is automatically defined.
public event EventHandler<AutoDefineElementEventArgs>? AutoDefineField
Event Type
AutoDefineNewPage
Occurs when a new page is triggered. Can be used to add additional identifiers.
public event EventHandler<AutoDefineNewPageEventArgs>? AutoDefineNewPage
Event Type
DefinePrintOptions
This event is called when a project has been loaded and allows to modify the project before it is used for printing.
public event EventHandler<DefinePrintOptionsEventArgs>? DefinePrintOptions
Event Type
NextCombinationPrintStep
This event is called if AutoProjectFile contains more than one project file separated by semicolons. In this case, a combination print is triggered and this event allows to change options between two print jobs of the combination.
public event EventHandler<NextCombinationPrintStepEventArgs>? NextCombinationPrintStep
Event Type
QueryFileNameForExportJob
Occurs when the file name for an export job is queried.
public event EventHandler<QueryFileNameForExportJobEventArgs>? QueryFileNameForExportJob