Table of Contents

Class CommonReportingArguments<TConcreteClass, TParam>

Namespace
GroupeIsa.Neos.Shared.Reports.Request
Assembly
GroupeIsa.Neos.Shared.dll

Represents the common arguments required for generating a report, including data extraction, transformation, and localization settings.

public abstract class CommonReportingArguments<TConcreteClass, TParam> where TConcreteClass : CommonReportingArguments<TConcreteClass, TParam>

Type Parameters

TConcreteClass

The type of the actual class that inherits from this abstract class. This is used to allow fluent API methods to return the correct type.

TParam

The type of the values stored in the dictionaries of parameters. Those can be:

  • a raw object? parameter (in the public ReportRequestArguments),

  • or a converted, strongly typed IEnumerable{string} (typically in ReportRequestArgumentsInternal).

Inheritance
CommonReportingArguments<TConcreteClass, TParam>
Derived
Inherited Members

Remarks

IMPORTANT REMINDER

If a new property is added, remember to update the custom binder ReportRequestArgumentsInternalBinder.

  • Is is used for binding the HTTP GET query.

Constructors

CommonReportingArguments(CommonReportingArguments<TConcreteClass, TParam>)

Initializes a new instance of the CommonReportingArguments<TConcreteClass, TParam> class by cloning an existing instance.

protected CommonReportingArguments(CommonReportingArguments<TConcreteClass, TParam> blueprint)

Parameters

blueprint CommonReportingArguments<TConcreteClass, TParam>

The data object to clone.

Remarks

COPY CONSTRUCTOR.

CommonReportingArguments(CultureInfo, string)

Initializes a new instance of the CommonReportingArguments<TConcreteClass, TParam> class.

protected CommonReportingArguments(CultureInfo internalFallbackCultureForDataLocalization, string reportName)

Parameters

internalFallbackCultureForDataLocalization CultureInfo

The fallback culture for localizing the report data for backward compatibility (labels, native variables, business data). (e.g. "fr", "fr-CA", "fr-FR", etc.). This property is used for not introducing any breaking change. It should be populated by the concrete classes and used as a fallback.

reportName string

Report name.

Properties

ActualDataCulture

Gets the culture object for localizing the business data (i.e. typically the data retrieved from the Neos endpoint). (e.g. "fr", "fr-CA", "fr-FR", etc.).

[JsonIgnore]
public CultureInfo ActualDataCulture { get; }

Property Value

CultureInfo

Remarks

May be different from the UICulture retrieved from HTTP Headers (or from the Thread's UI culture).

ActualTimeZone

Gets the time-zone object for localizing the DateTime properties.

[JsonIgnore]
public TimeZoneInfo ActualTimeZone { get; }

Property Value

TimeZoneInfo

ActualUICulture

Gets the culture object used for localizing the report's container (e.g. viewer, email). It is reapplied in the subscriber so that we know the language to use when sending an email. (NOTE: CultureInfo.CurrentUICulture = Thread.CurrentThread.CurrentUICulture.)

[JsonIgnore]
public CultureInfo ActualUICulture { get; }

Property Value

CultureInfo

Remarks

The fallback UI culture is not the same as the one retrieved from ReportLocalizationClr.GetCurrentUICultureName since the latter also uses headers on top of the thread's UI culture.

DestinationTimeZone

Gets a valid Windows or IANA time zone identifier for localizing the DateTime properties (but not the InvariantDateTime ones).

public string? DestinationTimeZone { get; }

Property Value

string

Remarks

For more information, see remarks associated with the WithDestinationTimeZone(string?) fluent method.

EntityViewParameters

Gets or sets entity-view parameters.

public IReadOnlyDictionary<string, TParam>? EntityViewParameters { get; protected set; }

Property Value

IReadOnlyDictionary<string, TParam>

ExplicitlyRequested_DataCulture

Gets or sets the nullable culture object for localizing the scaffolding of the report (text labels, table headers, native variables, date and numbers regional format, etc.).

This property is set (or not) by the user in the options.

[JsonIgnore]
public CultureInfo? ExplicitlyRequested_DataCulture { get; protected set; }

Property Value

CultureInfo

Remarks

In most cases, this is the same as LocalizationDataCulture. Except this value can be null, in which case the reference culture set in the template report is used.

ExplicitlyRequested_TimeZone

Gets or sets a nullable time-zone object for localizing the DateTime properties (but not the InvariantDateTime ones).

This property is set (or not) by the user in the options.

[JsonIgnore]
public TimeZoneInfo? ExplicitlyRequested_TimeZone { get; protected set; }

Property Value

TimeZoneInfo

Remarks

For more information, see remarks associated with the WithDestinationTimeZone(string?) fluent method.

ExplicitlyRequested_UICulture

Gets or sets the nullable culture object for localizing the report's container (e.g. viewer, email).

This property is set (or not) by the user in the options.

[JsonIgnore]
public CultureInfo? ExplicitlyRequested_UICulture { get; protected set; }

Property Value

CultureInfo

Remarks

It is reapplied in the subscriber so that we know the language to use when sending an email. (NOTE: CultureInfo.CurrentUICulture = Thread.CurrentThread.CurrentUICulture.)

Filter

Gets or sets filter in OData format apply on report DataSource.

public string? Filter { get; protected set; }

Property Value

string

InternalFallbackCultureCodenameForDataLocalization

Gets the codename of the fallback culture used for data localization. Intended for serialization and not for consumption.

public string InternalFallbackCultureCodenameForDataLocalization { get; }

Property Value

string

InternalFallbackCultureForDataLocalization

Gets the (PROTECTED) fallback culture codename for localizing the report data (labels, native variables, business data).

This property was introduced to prevent any breaking change. It is mandatory and populated by the concrete classes in the abstract constructor.

[JsonIgnore]
public CultureInfo InternalFallbackCultureForDataLocalization { get; }

Property Value

CultureInfo

Remarks

NOT NULLABLE.

LocalizationDataCulture

Gets the nullable culture codename for localizing the scaffolding of the report (text labels, table headers, native variables, date and numbers regional format, etc.).

This property is set (or not) by the user in the options.

public string? LocalizationDataCulture { get; }

Property Value

string

Remarks

In most cases, this is the same as LocalizationDataCulture. Except this value can be null, in which case the reference culture set in the template report is used.

LocalizationUICulture

Gets the nullable culture codename for localizing the report's container (e.g. viewer, email).

This property is set (or not) by the user in the options.

public string? LocalizationUICulture { get; }

Property Value

string

Remarks

It is reapplied in the subscriber so that we know the language to use when sending an email. (NOTE: CultureInfo.CurrentUICulture = Thread.CurrentThread.CurrentUICulture.)

Parameters

Gets or sets report variables.

public IReadOnlyDictionary<string, TParam>? Parameters { get; protected set; }

Property Value

IReadOnlyDictionary<string, TParam>

ReportName

Gets or sets the name of the template used for report generation.

public string ReportName { get; protected set; }

Property Value

string

StylesBundle

Gets or sets the name of the bundle containing the collection of styles.

public string? StylesBundle { get; protected set; }

Property Value

string

UIViewName

Gets or sets the name of the UIView showing this report (used for passing the 'neos-ui-view-name' HTTP header when using QuickSearch).

public string? UIViewName { get; protected set; }

Property Value

string

Methods

WithDestinationTimeZone(string?)

Set the time-zone for localizing the DateTime properties (but not the InvariantDateTime ones).

public TConcreteClass WithDestinationTimeZone(string? windowsOrIanaTimeZoneId)

Parameters

windowsOrIanaTimeZoneId string

The Windows or IANA time zone identifier.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If set to null the generation should use the UTC time.

WithEntityViewParameter(string, TParam)

Add an EntityView parameter to the existing dictionary (or creates one if there wasn't any).

public TConcreteClass WithEntityViewParameter(string key, TParam value)

Parameters

key string

EntityView Parameter key.

value TParam

EntityView Parameter value.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If the key already exists, the value will be replaced.

WithEntityViewParameters(Dictionary<string, TParam>?)

Set new entity-view parameters (replaces the previous dictionary).

public TConcreteClass WithEntityViewParameters(Dictionary<string, TParam>? entityViewParameters)

Parameters

entityViewParameters Dictionary<string, TParam>

Parameters for the Neos endpoint that provides the data.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If entityViewParameters already exists, the value will be replaced.

WithEntityViewParameters(IReadOnlyDictionary<string, TParam>?)

Set new entity-view parameters (replaces the previous dictionary).

public TConcreteClass WithEntityViewParameters(IReadOnlyDictionary<string, TParam>? entityViewParameters)

Parameters

entityViewParameters IReadOnlyDictionary<string, TParam>

Parameters for the Neos endpoint that provides the data.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If entityViewParameters already exists, the value will be replaced.

WithFilter(string?)

Set Filter.

public TConcreteClass WithFilter(string? filter)

Parameters

filter string

Filter in OData format apply on report DataSource.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

WithLocalizationDataCulture(string?)

Set the culture for localizing the report data (labels, native variables, business data).

public TConcreteClass WithLocalizationDataCulture(string? localizationDataCulture)

Parameters

localizationDataCulture string

The culture codename.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If set to null the generation should use:

  • (IN PRIORITY) the reference culture set in the template report

  • or the "en" language if the generation is triggered via ReportRequestArguments if the reference culture is not set in the template

  • or eventually the current data culture of the thread

    • if the generation is triggered via ReportRequestArgumentsInternal
    • and that no other fallback culture was specified.

WithLocalizationUICulture(string?)

Set the culture used for localizing the report's container (e.g. viewer, email).

public TConcreteClass WithLocalizationUICulture(string? localizationUICulture)

Parameters

localizationUICulture string

The culture codename.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If set to null the value will end up being:

  • the one extracted from the headers
  • or the current UI culture of the thread.

WithParameter(string, TParam)

Add a parameter to the existing dictionary (or creates one if there wasn't any).

public TConcreteClass WithParameter(string key, TParam value)

Parameters

key string

Parameter key.

value TParam

Parameter value.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If the key already exists, the value will be replaced.

WithParameters(IReadOnlyDictionary<string, TParam>?)

Set new parameters (replaces the previous dictionary).

public TConcreteClass WithParameters(IReadOnlyDictionary<string, TParam>? reportParameters)

Parameters

reportParameters IReadOnlyDictionary<string, TParam>

Parameters to provide to the third-party report engine.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

If parameters already exists, the value will be replaced.

WithStylesCollection(string?)

Sets the name of the bundle containing the collection of styles.

public TConcreteClass WithStylesCollection(string? stylesBundle)

Parameters

stylesBundle string

Name of the bundle containing the collection of styles.

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.

Remarks

At the moment, there is only one parameter because we will always apply the 'AutomaticNeosStyles'.

WithUIViewName(string?)

Set the name of the UIView associated with the EntityView.

public TConcreteClass WithUIViewName(string? uiViewName)

Parameters

uiViewName string

Name of the UIView associated with the endpoint. (possibly needed for QuickSearch OData filter, see the "data extraction" section).

Returns

TConcreteClass

Modified instance of CommonReportingArguments<TConcreteClass, TParam>.