Class CommonReportingArguments<TConcreteClass, TParam>
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
TConcreteClassThe type of the actual class that inherits from this abstract class. This is used to allow fluent API methods to return the correct type.
TParamThe 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
blueprintCommonReportingArguments<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
internalFallbackCultureForDataLocalizationCultureInfoThe 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.
reportNamestringReport 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
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
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
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
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
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
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
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
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
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
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
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
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
StylesBundle
Gets or sets the name of the bundle containing the collection of styles.
public string? StylesBundle { get; protected set; }
Property Value
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
Methods
WithDestinationTimeZone(string?)
Set the time-zone for localizing the DateTime properties (but not the InvariantDateTime ones).
public TConcreteClass WithDestinationTimeZone(string? windowsOrIanaTimeZoneId)
Parameters
windowsOrIanaTimeZoneIdstringThe 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
keystringEntityView Parameter key.
valueTParamEntityView 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
entityViewParametersDictionary<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
entityViewParametersIReadOnlyDictionary<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
filterstringFilter 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
localizationDataCulturestringThe 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
localizationUICulturestringThe 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
keystringParameter key.
valueTParamParameter 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
reportParametersIReadOnlyDictionary<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
stylesBundlestringName 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
uiViewNamestringName 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>.