Show / Hide Table of Contents

Class ReportEndFunction

Post-processes the assembled report data set after all queries have been executed.

Inheritance
object
Function
ReportFunction
ReportEndFunction
Implements
IDisposable
Inherited Members
ReportFunction.GetReportAttribute(string)
ReportFunction.GetReportAttribute<T>(string, T)
ReportFunction.SetReportAttribute(string, object)
ReportFunction.HasParameter(string)
ReportFunction.GetParameter(string)
ReportFunction.GetParameter<T>(string, T)
ReportFunction.GetParameterAttribute(string, string)
ReportFunction.GetParameterAttribute<T>(string, string, T)
ReportFunction.SetParameterAttribute(string, string, object)
ReportFunction.ParameterHidden(string)
ReportFunction.AddReportLog(string, string, DateTime?)
ReportFunction.ToReportMessage(string)
ReportFunction.ExecuteQuery(string, string, Dictionary<string, string>)
ReportFunction.ExecuteQuery(string, string, string, Dictionary<string, string>)
ReportFunction.ExecuteQuery(string, Dictionary<string, string>)
ReportFunction.ExecuteDivisionQuery(int)
ReportFunction.ExecutePayrollDivisionIdQuery(int)
ReportFunction.ExecutePayrollDivisionQuery(int)
ReportFunction.ExecuteLookupValueQuery(int, string, string, string)
ReportFunction.ExecuteGlobalCaseValueQuery(string, ReportQuery)
ReportFunction.ExecuteNationalCaseValueQuery(string, ReportQuery)
ReportFunction.ExecuteCompanyCaseValueQuery(string, ReportQuery)
ReportFunction.ExecuteEmployeeCaseValueQuery(string, int, ReportQuery)
ReportFunction.ExecuteWageTypeQuery(string, int, ReportQuery)
ReportFunction.ExecutePayrollResultQuery(string, ReportQuery)
ReportFunction.ExecuteWageTypeResultQuery(string, int, ReportQuery)
ReportFunction.ExecuteWageTypeCustomResultQuery(string, int, int, ReportQuery)
ReportFunction.ExecuteCollectorResultQuery(string, int, ReportQuery)
ReportFunction.ExecuteCollectorCustomResultQuery(string, int, int, ReportQuery)
ReportFunction.ExecutePayrunResultQuery(string, int, ReportQuery)
ReportFunction.GetOperationBaseName(string)
ReportFunction.ExecuteValueQuery<T>(string, string, Dictionary<string, string>)
ReportFunction.ExecuteValueQuery<T>(string, string, Dictionary<string, string>, T)
ReportFunction.ExecuteLookupQuery(int, string, string, DateTime?, DateTime?)
ReportFunction.ExecuteLookupQuery(int, IEnumerable<string>, string, DateTime?, DateTime?)
ReportFunction.ExecuteCaseFieldQuery(int, IEnumerable<string>, string, DateTime?, DateTime?)
ReportFunction.ExecuteEmployeeTimeCaseValueQuery(string, int, IEnumerable<int>, IEnumerable<CaseValueColumn>, string, DateTime?, DateTime?, DateTime?)
ReportFunction.ExecuteRawCaseValueQuery(string, int, IEnumerable<string>, DatePeriod, DateTime?, DateTime?)
ReportFunction.ExecuteRawCaseValueQuery(string, int, int, IEnumerable<string>, DatePeriod, DateTime?, DateTime?)
ReportFunction.ExecuteRawCaseValueQuery(string, int, IEnumerable<string>, DateTime?, DateTime?, DateTime?, DateTime?)
ReportFunction.ExecuteRawCaseValueQuery(string, int, int, IEnumerable<string>, DateTime?, DateTime?, DateTime?, DateTime?)
ReportFunction.ResolveParameterUserId()
ReportFunction.ResolveParameterEmployeeId()
ReportFunction.ResolveParameterRegulationId()
ReportFunction.ResolveParameterPayrollId()
ReportFunction.ResolveParameterPayrunId()
ReportFunction.ResolveIdentifierParameter(string, string)
ReportFunction.ResolveNameParameter(string, string)
ReportFunction.AddInfo(string, object)
ReportFunction.RemoveInfo(string)
ReportFunction.ReportName
Function.GetTenantAttribute(string)
Function.GetTenantAttribute<T>(string, T)
Function.GetUserAttribute(string)
Function.GetUserAttribute<T>(string, T)
Function.GetDerivedCulture(int, int)
Function.GetDerivedCalendar(int, int)
Function.GetCalendarDayCount(DateTime, DateTime, string)
Function.GetCalendarDayCount(string, DateTime, DateTime, string)
Function.IsCalendarWorkDay(string, DateTime?)
Function.IsCalendarWorkDay(DateTime?)
Function.GetPreviousWorkDay(string, DateTime?)
Function.GetPreviousWorkDays(string, DateTime?, int)
Function.GetNextWorkDay(string, DateTime?)
Function.GetNextWorkDays(string, DateTime?, int)
Function.GetCalendarPeriod(DateTime?, int, int, int)
Function.GetCalendarPeriod(string, DateTime?, int, string)
Function.LogVerbose(string, string, string)
Function.LogDebug(string, string, string)
Function.LogInformation(string, string, string)
Function.LogWarning(string, string, string)
Function.LogError(string, string, string)
Function.LogError(Exception, string, string)
Function.LogFatal(string, string, string)
Function.LogFatal(Exception, string, string)
Function.Log(LogLevel, string, string, string)
Function.AddTask(string, string, DateTime, string, Dictionary<string, object>)
Function.InvokeWebhook<T>(string, object)
Function.GetSourceFileName(string)
Function.ChangeValueType<T>(object, T, IFormatProvider)
Function.Dispose()
Function.Runtime
Function.TenantId
Function.TenantIdentifier
Function.UserId
Function.UserIdentifier
Function.UserCulture
Function.UserType
Function.SelfServiceUser
Function.AdminUser
Function.SourceFileName
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class ReportEndFunction : ReportFunction, IDisposable
Remarks

This function runs once per report execution, after the report engine has populated the DataSet from all registered queries. It receives the complete data set and can add, remove, or transform tables, define inter-table relations, and execute supplementary queries.

Typical uses:

  • Execute supplementary queries and add the results as new tables (ExecuteResultQuery(string, string, Dictionary<string, string>)).
  • Remove intermediate or temporary tables that should not appear in the output (RemoveTables(params string[])).
  • Add parent-child relations between tables for hierarchical reports (AddRelation(string, string, string, string)).
  • Compute aggregates or derived values directly on the data set (Compute<T>(string, string, string)).
  • Merge additional data into an existing table via ExecuteMergeQuery(string, string, string, Dictionary<string, string>, DataMergeSchemaChange).

Return value: Return null to deliver the data set to the renderer. Return false to abort report delivery after data assembly.

Examples
// Remove a staging table and add a parent-child relation
RemoveTable("TempEmployees");
AddRelation("PayrollEmployees", "Payrolls", "WageTypeResults", "PayrollResultId");

Constructors

View Source

ReportEndFunction(object)

Initializes a new instance with the function runtime

Declaration
public ReportEndFunction(object runtime)
Parameters
Type Name Description
object runtime

The runtime

View Source

ReportEndFunction(string)

New function instance without runtime (scripting development)

Declaration
public ReportEndFunction(string sourceFileName)
Parameters
Type Name Description
string sourceFileName

The name of the source file

Properties

View Source

DataSet

The report data set

Declaration
public DataSet DataSet { get; }
Property Value
Type Description
DataSet
View Source

Tables

The report data tables

Declaration
public DataTableCollection Tables { get; }
Property Value
Type Description
DataTableCollection

Methods

View Source

AddRelation(string, string, string, string)

Add relation between two table

Declaration
public DataRelation AddRelation(string relationName, string parentTableName, string childTableName, string childColumnName)
Parameters
Type Name Description
string relationName

The relation name

string parentTableName

The relation parent table name

string childTableName

The relation child table name

string childColumnName

The relation child table column name

Returns
Type Description
DataRelation
View Source

AddRelation(string, string, string, string, string)

Add relation between two table

Declaration
public DataRelation AddRelation(string relationName, string parentTableName, string parentColumnName, string childTableName, string childColumnName)
Parameters
Type Name Description
string relationName

The relation name

string parentTableName

The relation parent table name

string parentColumnName

The relation parent table column name

string childTableName

The relation child table name

string childColumnName

The relation child table column name

Returns
Type Description
DataRelation
View Source

AddTable(DataTable)

Add a table to the data set

Declaration
public void AddTable(DataTable table)
Parameters
Type Name Description
DataTable table

The table

View Source

AddTable(string)

Add a table to the data set

Declaration
public DataTable AddTable(string tableName)
Parameters
Type Name Description
string tableName

Name of the table

Returns
Type Description
DataTable
View Source

Compute(string, string, string)

Computes the given expression on the current rows that pass the filter criteria

Declaration
public object Compute(string tableName, string expression, string filter = null)
Parameters
Type Name Description
string tableName

Name of the table

string expression

The expression to compute

string filter

The filter to limit the rows that evaluate in the expression

Returns
Type Description
object

An Object, set to the result of the computation. If the expression evaluates to null, the return value will be Value

View Source

Compute<T>(string, string, string)

Computes the given expression on the current rows that pass the filter criteria

Declaration
public T Compute<T>(string tableName, string expression, string filter = null)
Parameters
Type Name Description
string tableName

Name of the table

string expression

The expression to compute

string filter

The filter to limit the rows that evaluate in the expression

Returns
Type Description
T

An Object, set to the result of the computation. If the expression evaluates to null, the return value will be Value

Type Parameters
Name Description
T
View Source

ContainsTable(string)

Determines whether the table contains the specified table

Declaration
public bool ContainsTable(string tableName)
Parameters
Type Name Description
string tableName

Name of the table

Returns
Type Description
bool

True for an existing table

View Source

End()

Entry point for the runtime

Declaration
public object End()
Returns
Type Description
object
Remarks

Internal usage only, do not call this method

View Source

ExecuteMergeQuery(string, string, string, Dictionary<string, string>, DataMergeSchemaChange)

Execute a query on the Api web method and merge the table to the set

Declaration
public DataTable ExecuteMergeQuery(string tableName, string methodName, string mergeColumn, Dictionary<string, string> parameters = null, DataMergeSchemaChange schemaChange = DataMergeSchemaChange.Add)
Parameters
Type Name Description
string tableName

Target table name

string methodName

The query name

string mergeColumn

The column used to merge (primary key column)

Dictionary<string, string> parameters

The method parameters

DataMergeSchemaChange schemaChange

Action to take when the required data column is missing

Returns
Type Description
DataTable

New or expanded data table

View Source

ExecuteMergeQuery(string, string, string, string, Dictionary<string, string>, DataMergeSchemaChange)

Execute a query on the Api web method and merge the table to the set

Declaration
public DataTable ExecuteMergeQuery(string tableName, string methodName, string culture, string mergeColumn, Dictionary<string, string> parameters = null, DataMergeSchemaChange schemaChange = DataMergeSchemaChange.Add)
Parameters
Type Name Description
string tableName

Target table name

string methodName

The query name

string culture

The content culture

string mergeColumn

The column used to merge (primary key column)

Dictionary<string, string> parameters

The method parameters

DataMergeSchemaChange schemaChange

Action to take when the required data column is missing

Returns
Type Description
DataTable

New or expanded data table

View Source

ExecuteResultQuery(string, Dictionary<string, string>)

Execute a query on the Api web method, table name extracted from method name

Declaration
public DataTable ExecuteResultQuery(string methodName, Dictionary<string, string> parameters = null)
Parameters
Type Name Description
string methodName

The query name

Dictionary<string, string> parameters

The method parameters

Returns
Type Description
DataTable

New data table, null on empty collection

View Source

ExecuteResultQuery(string, string, Dictionary<string, string>)

Execute a query on the Api web method

Declaration
public DataTable ExecuteResultQuery(string tableName, string methodName, Dictionary<string, string> parameters = null)
Parameters
Type Name Description
string tableName

Target table name

string methodName

The query name

Dictionary<string, string> parameters

The method parameters

Returns
Type Description
DataTable

New data table, null on empty collection

View Source

ExecuteResultQuery(string, string, string, bool, Dictionary<string, string>)

Execute a result query on the Api web method

Declaration
public DataTable ExecuteResultQuery(string tableName, string methodName, string culture, bool resultQuery, Dictionary<string, string> parameters = null)
Parameters
Type Name Description
string tableName

Target table name

string methodName

The query name

string culture

The content culture

bool resultQuery

Add query table to the data set

Dictionary<string, string> parameters

The method parameters

Returns
Type Description
DataTable

New data table, null on empty collection

View Source

RemoveTable(string)

Remove a table from the data set

Declaration
public void RemoveTable(string tableName)
Parameters
Type Name Description
string tableName

Name of the table

View Source

RemoveTables(params string[])

Remove multiple tables from the data set

Declaration
public void RemoveTables(params string[] tableNames)
Parameters
Type Name Description
string[] tableNames

Name of the tables

Implements

IDisposable

Extension Methods

ConsoleExtensions.WriteProperties(object, bool)
ValueTypeExtensions.GetValueType(object)
ObjectInfo.GetPropertyValue(object, string)
ObjectInfo.GetPropertyValue<T>(object, string, T)
ObjectInfo.ResolvePropertyValue(object, string)
ObjectInfo.SetPropertyValue(object, string, object)

See Also

ReportBuildFunction
ReportStartFunction
  • View Source
☀
☾
Back to top Generated by DocFX