Class ListLabelConfiguration
- Namespace
- combit.Reporting
- Assembly
- combit.ListLabel32.CrossPlatform.dll
Provides instance-level configuration options for a ListLabel reporting engine instance.
public sealed class ListLabelConfiguration
- Inheritance
-
ListLabelConfiguration
- Inherited Members
Remarks
An instance of this class is accessible via Configuration. Configure the instance once after constructing the ListLabel object, before any rendering or export operations are performed.
Properties
ExportOptions
Gets or sets the export options used when printing to an export destination.
public ListLabelExportOptions ExportOptions { get; set; }
Property Value
HttpClientFactory
Gets or sets a factory function that creates or returns an HttpClient instance used for downloading contents from HTTP or HTTPS URLs.
public Func<HttpClientFactoryContext, HttpClient>? HttpClientFactory { get; set; }
Property Value
Examples
The following example shows how to configure header propagation in an ASP.NET Core application:
// In Program.cs / Startup.cs:
builder.Services.AddHttpClient("ListLabelImageDownload");
builder.Services.AddHeaderPropagation(options =>
{
options.Headers.Add("Authorization");
options.Headers.Add("X-Correlation-ID");
});
builder.Services.AddSingleton<IHttpClientFactory>(sp =>
sp.GetRequiredService<IHttpClientFactory>());
// After building the app, wire up the factory:
var httpClientFactory = app.Services.GetRequiredService<IHttpClientFactory>();
ListLabelConfiguration.HttpClientFactory = (context) =>
httpClientFactory.CreateClient("ListLabelImageDownload");
The context.Url property can be used to select different named clients or apply
request-specific logic based on the URL being downloaded.
Remarks
When this property is null (the default), the reporting engine uses an internal shared
HttpClient with a 10-second timeout.
Set this property at application startup to supply a pre-configured client. This is particularly
useful in hosted environments such as ASP.NET Core, where the factory can return a client obtained
from IHttpClientFactory that already has header propagation (e.g. Authorization,
load-balancer metadata, or correlation identifiers) configured via the ASP.NET Core middleware
pipeline.
The factory is invoked once per URL download and receives an HttpClientFactoryContext that carries contextual information about the request, such as the target URL. Use this context to vary the returned client or its configuration depending on the download being performed.
If the factory returns a client obtained from IHttpClientFactory, that client's lifetime is
managed by the factory infrastructure and the reporting engine will not dispose it. If the
factory returns a self-owned client that requires disposal, the factory itself is responsible for
managing that lifetime.
MaximumIdleIterationsPerObject
Gets or sets the maximum number of consecutive iterations an object may remain at the same render progress before the engine treats it as stalled and throws a ListLabelException.
public int MaximumIdleIterationsPerObject { get; set; }
Property Value
Remarks
A value of 0 disables stall detection. The default value is 1000.