Show / Hide Table of Contents

Class ReportFunction

Base class for report functions

Inheritance
object
Function
ReportFunction
ReportBuildFunction
ReportEndFunction
ReportStartFunction
Implements
IDisposable
Inherited Members
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 abstract class ReportFunction : Function, IDisposable

Constructors

ReportFunction(object)

Initializes a new instance with the function runtime

Declaration
protected ReportFunction(object runtime)
Parameters
Type Name Description
object runtime

The runtime

ReportFunction(string)

New function instance without runtime (scripting development)

Declaration
protected ReportFunction(string sourceFileName)
Parameters
Type Name Description
string sourceFileName

The name of the source file

Remarks

Use GetSourceFileName(string) in your constructor for the source file name

Properties

ReportName

Gets the report name

Declaration
public string ReportName { get; }
Property Value
Type Description
string

The name of the case

Methods

AddInfo(string, object)

Add build info

Declaration
public void AddInfo(string name, object value)
Parameters
Type Name Description
string name

Info name

object value

Info value

AddReportLog(string, string, DateTime?)

Add report log

Declaration
public void AddReportLog(string message, string key = null, DateTime? reportDate = null)
Parameters
Type Name Description
string message

The log message

string key

The log key

DateTime? reportDate

The report date (default: now)

ExecuteCaseFieldQuery(int, IEnumerable<string>, string, DateTime?, DateTime?)

Get payroll case fields

Declaration
public DataTable ExecuteCaseFieldQuery(int payrollId, IEnumerable<string> caseFieldNames = null, string clusterSetName = null, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
int payrollId

The payroll id

IEnumerable<string> caseFieldNames

The case field names

string clusterSetName

The cluster set

DateTime? regulationDate

The regulation date

DateTime? evaluationDate

The evaluation date

Returns
Type Description
DataTable

Payroll case fields

ExecuteCollectorCustomResultQuery(string, int, int, ReportQuery)

Query collector custom results

Declaration
public DataTable ExecuteCollectorCustomResultQuery(string tableName, int payrollResultId, int collectorResultId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int payrollResultId

The payroll result id

int collectorResultId

The collector result id

ReportQuery query

The query

Returns
Type Description
DataTable

Collector custom result data table, null on empty collection

ExecuteCollectorResultQuery(string, int, ReportQuery)

Query collector results

Declaration
public DataTable ExecuteCollectorResultQuery(string tableName, int payrollResultId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int payrollResultId

The payroll result id

ReportQuery query

The query

Returns
Type Description
DataTable

Collector result data table, null on empty collection

ExecuteCompanyCaseValueQuery(string, ReportQuery)

Execute company case value query on the Api web method

Declaration
public DataTable ExecuteCompanyCaseValueQuery(string tableName, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

ReportQuery query

The query

Returns
Type Description
DataTable

Resulting data table, existing will be removed

ExecuteDivisionQuery(int)

Query the division by id

Declaration
public DataTable ExecuteDivisionQuery(int divisionId)
Parameters
Type Name Description
int divisionId

The division id

Returns
Type Description
DataTable

Single row table

ExecuteEmployeeCaseValueQuery(string, int, ReportQuery)

Execute employee case value query on the Api web method

Declaration
public DataTable ExecuteEmployeeCaseValueQuery(string tableName, int employeeId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int employeeId

The employee id

ReportQuery query

The query

Returns
Type Description
DataTable

Resulting data table, existing will be removed

ExecuteEmployeeTimeCaseValueQuery(string, int, IEnumerable<int>, IEnumerable<CaseValueColumn>, string, DateTime?, DateTime?, DateTime?)

Get employees case values as table. Table structure: first column is the employee id, and for any case field a column

Declaration
public DataTable ExecuteEmployeeTimeCaseValueQuery(string tableName, int payrollId, IEnumerable<int> employeeIds, IEnumerable<CaseValueColumn> columns, string culture, DateTime? valueDate = null, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
string tableName

The table name

int payrollId

The payroll id

IEnumerable<int> employeeIds

The employee ids

IEnumerable<CaseValueColumn> columns

The table columns

string culture

The culture

DateTime? valueDate

The value date

DateTime? regulationDate

The regulation date

DateTime? evaluationDate

The evaluation date

Returns
Type Description
DataTable

Employees case values

ExecuteGlobalCaseValueQuery(string, ReportQuery)

Execute global case value query on the Api web method

Declaration
public DataTable ExecuteGlobalCaseValueQuery(string tableName, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

ReportQuery query

The query

Returns
Type Description
DataTable

Resulting data table, existing will be removed

ExecuteLookupQuery(int, IEnumerable<string>, string, DateTime?, DateTime?)

Get lookup values, grouped by lookup

Declaration
public Dictionary<string, Dictionary<string, string>> ExecuteLookupQuery(int payrollId, IEnumerable<string> lookupNames, string culture, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
int payrollId

The payroll id

IEnumerable<string> lookupNames

The lookup names

string culture

The culture

DateTime? regulationDate

The regulation date

DateTime? evaluationDate

The evaluation date

Returns
Type Description
Dictionary<string, Dictionary<string, string>>

Lookup values dictionary by lookup name, value is a key/value dictionary

ExecuteLookupQuery(int, string, string, DateTime?, DateTime?)

Get lookup values, grouped by lookup

Declaration
public Dictionary<string, string> ExecuteLookupQuery(int payrollId, string lookupName, string culture, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
int payrollId

The payroll id

string lookupName

The lookup name

string culture

The culture

DateTime? regulationDate

The regulation date

DateTime? evaluationDate

The evaluation date

Returns
Type Description
Dictionary<string, string>

Lookup values dictionary by lookup name, value is a key/value dictionary

ExecuteLookupValueQuery(int, string, string, string)

Query Json lookup values by lookup name

Declaration
public Dictionary<string, string> ExecuteLookupValueQuery(int regulationId, string lookupName, string keyAttribute, string valueAttribute)
Parameters
Type Name Description
int regulationId

The regulation id

string lookupName

The lookup name

string keyAttribute

The json object key attribute name

string valueAttribute

The json object value attribute name

Returns
Type Description
Dictionary<string, string>

The lookup values dictionary

ExecuteNationalCaseValueQuery(string, ReportQuery)

Execute national case value query on the Api web method

Declaration
public DataTable ExecuteNationalCaseValueQuery(string tableName, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

ReportQuery query

The query

Returns
Type Description
DataTable

Resulting data table, existing will be removed

ExecutePayrollDivisionIdQuery(int)

Query the regulation id from the parameter RegulationId

Declaration
public int? ExecutePayrollDivisionIdQuery(int payrollId)
Parameters
Type Name Description
int payrollId

The payroll id

Returns
Type Description
int?

The regulation id, null for unknown regulation

ExecutePayrollDivisionQuery(int)

Query the regulation id from the parameter RegulationId

Declaration
public DataTable ExecutePayrollDivisionQuery(int payrollId)
Parameters
Type Name Description
int payrollId

The payroll id

Returns
Type Description
DataTable

Single row table

ExecutePayrollResultQuery(string, ReportQuery)

Query payroll results

Declaration
public DataTable ExecutePayrollResultQuery(string tableName, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

ReportQuery query

The query

Returns
Type Description
DataTable

Payroll result data table, null on empty collection

ExecutePayrunResultQuery(string, int, ReportQuery)

Query payrun results

Declaration
public DataTable ExecutePayrunResultQuery(string tableName, int payrollResultId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int payrollResultId

The payroll result id

ReportQuery query

The query

Returns
Type Description
DataTable

Payrun result data table, null on empty collection

ExecuteQuery(string, Dictionary<string, string>)

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

Declaration
public DataTable ExecuteQuery(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

ExecuteQuery(string, string, Dictionary<string, string>)

Query on Api web method with the user culture

Declaration
public DataTable ExecuteQuery(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

ExecuteQuery(string, string, string, Dictionary<string, string>)

Query on Api web method

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

Target table name

string methodName

The query name

string culture

The content culture

Dictionary<string, string> parameters

The method parameters

Returns
Type Description
DataTable

New data table, null on empty collection

ExecuteRawCaseValueQuery(string, int, IEnumerable<string>, DatePeriod, DateTime?, DateTime?)

Execute case value query on period

Declaration
public DataTable ExecuteRawCaseValueQuery(string tableName, int payrollId, IEnumerable<string> caseFieldNames, DatePeriod period, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
string tableName

Table name

int payrollId

Payroll id

IEnumerable<string> caseFieldNames

The case field names

DatePeriod period

Value period

DateTime? regulationDate

The regulation date (default: UTC now)

DateTime? evaluationDate

The evaluation date (default: UTC now)

Returns
Type Description
DataTable

Data table including for any case filed a column

ExecuteRawCaseValueQuery(string, int, IEnumerable<string>, DateTime?, DateTime?, DateTime?, DateTime?)

Execute case value query

Declaration
public DataTable ExecuteRawCaseValueQuery(string tableName, int payrollId, IEnumerable<string> caseFieldNames, DateTime? periodStart = null, DateTime? periodEnd = null, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
string tableName

Table name

int payrollId

Payroll id

IEnumerable<string> caseFieldNames

The case field names

DateTime? periodStart

Value period start date

DateTime? periodEnd

Value period end date

DateTime? regulationDate

The regulation date (default: UTC now)

DateTime? evaluationDate

The evaluation date (default: UTC now)

Returns
Type Description
DataTable

Data table including for any case filed a column

ExecuteRawCaseValueQuery(string, int, int, IEnumerable<string>, DatePeriod, DateTime?, DateTime?)

Execute employee case value query on period

Declaration
public DataTable ExecuteRawCaseValueQuery(string tableName, int payrollId, int employeeId, IEnumerable<string> caseFieldNames, DatePeriod period, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
string tableName

Table name

int payrollId

Payroll id

int employeeId

Employee id

IEnumerable<string> caseFieldNames

The case field names

DatePeriod period

Value period

DateTime? regulationDate

The regulation date (default: UTC now)

DateTime? evaluationDate

The evaluation date (default: UTC now)

Returns
Type Description
DataTable

Data table including for any case filed a column

ExecuteRawCaseValueQuery(string, int, int, IEnumerable<string>, DateTime?, DateTime?, DateTime?, DateTime?)

Execute employee case value query

Declaration
public DataTable ExecuteRawCaseValueQuery(string tableName, int payrollId, int employeeId, IEnumerable<string> caseFieldNames, DateTime? startDate = null, DateTime? endDate = null, DateTime? regulationDate = null, DateTime? evaluationDate = null)
Parameters
Type Name Description
string tableName

Table name

int payrollId

Payroll id

int employeeId

Employee id

IEnumerable<string> caseFieldNames

The case field names

DateTime? startDate

Value period start date

DateTime? endDate

Value period end date

DateTime? regulationDate

The regulation date (default: UTC now)

DateTime? evaluationDate

The evaluation date (default: UTC now)

Returns
Type Description
DataTable

Data table including for any case filed a column

ExecuteValueQuery<T>(string, string, Dictionary<string, string>)

Execute a value query on the Api web method

Declaration
public T ExecuteValueQuery<T>(string methodName, string attributeName, Dictionary<string, string> parameters)
Parameters
Type Name Description
string methodName

The query name

string attributeName

Name of the attribute

Dictionary<string, string> parameters

The method parameters

Returns
Type Description
T

Resulting data table, existing will be removed

Type Parameters
Name Description
T

ExecuteValueQuery<T>(string, string, Dictionary<string, string>, T)

Execute a value query on the Api web method

Declaration
public T ExecuteValueQuery<T>(string methodName, string attributeName, Dictionary<string, string> parameters, T defaultValue)
Parameters
Type Name Description
string methodName

The query name

string attributeName

Name of the attribute

Dictionary<string, string> parameters

The method parameters

T defaultValue

The method parameters

Returns
Type Description
T

Resulting data table, existing will be removed

Type Parameters
Name Description
T

ExecuteWageTypeCustomResultQuery(string, int, int, ReportQuery)

Query wage type custom results

Declaration
public DataTable ExecuteWageTypeCustomResultQuery(string tableName, int payrollResultId, int wageTypeResultId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int payrollResultId

The payroll result id

int wageTypeResultId

The wage type result id

ReportQuery query

The query

Returns
Type Description
DataTable

Wage type custom result data table, null on empty collection

ExecuteWageTypeQuery(string, int, ReportQuery)

Query regulation wage

Declaration
public DataTable ExecuteWageTypeQuery(string tableName, int regulationId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int regulationId

The regulation id

ReportQuery query

The query

Returns
Type Description
DataTable

Wage type data table, null on empty collection

ExecuteWageTypeResultQuery(string, int, ReportQuery)

Query wage type results

Declaration
public DataTable ExecuteWageTypeResultQuery(string tableName, int payrollResultId, ReportQuery query = null)
Parameters
Type Name Description
string tableName

Target table name

int payrollResultId

The payroll result id

ReportQuery query

The query

Returns
Type Description
DataTable

Wage type result data table, null on empty collection

GetOperationBaseName(string)

Get operation base name

Declaration
public static string GetOperationBaseName(string operation)
Parameters
Type Name Description
string operation

The operation name

Returns
Type Description
string

Operation base name

GetParameter(string)

Get report parameter

Declaration
public string GetParameter(string parameterName)
Parameters
Type Name Description
string parameterName

The parameter name

Returns
Type Description
string

The report parameter value as JSON

GetParameterAttribute(string, string)

Get report parameter attribute value

Declaration
public object GetParameterAttribute(string parameterName, string attributeName)
Parameters
Type Name Description
string parameterName

The parameter name

string attributeName

Name of the attribute

Returns
Type Description
object

The report attribute value

GetParameterAttribute<T>(string, string, T)

Get report parameter attribute typed value

Declaration
public T GetParameterAttribute<T>(string parameterName, string attributeName, T defaultValue = default)
Parameters
Type Name Description
string parameterName

The parameter name

string attributeName

Name of the attribute

T defaultValue

The default value

Returns
Type Description
T

The report attribute value

Type Parameters
Name Description
T

GetParameter<T>(string, T)

Get report parameter typed value

Declaration
public T GetParameter<T>(string parameterName, T defaultValue = default)
Parameters
Type Name Description
string parameterName

The parameter name

T defaultValue

The default value

Returns
Type Description
T

The report parameter value

Type Parameters
Name Description
T

GetReportAttribute(string)

Get report attribute value

Declaration
public object GetReportAttribute(string attributeName)
Parameters
Type Name Description
string attributeName

Name of the attribute

Returns
Type Description
object

The report attribute value

GetReportAttribute<T>(string, T)

Get report attribute typed value

Declaration
public T GetReportAttribute<T>(string attributeName, T defaultValue = default)
Parameters
Type Name Description
string attributeName

Name of the attribute

T defaultValue

The default value

Returns
Type Description
T

The report attribute value

Type Parameters
Name Description
T

HasParameter(string)

Check for existing report parameter

Declaration
public bool HasParameter(string parameterName)
Parameters
Type Name Description
string parameterName

The parameter name

Returns
Type Description
bool

ParameterHidden(string)

Test for hidden report parameter

Declaration
public bool ParameterHidden(string parameterName)
Parameters
Type Name Description
string parameterName

The parameter name

Returns
Type Description
bool

True for hidden report attribute

RemoveInfo(string)

Remove build info

Declaration
public void RemoveInfo(string name)
Parameters
Type Name Description
string name

Info name

ResolveIdentifierParameter(string, string)

Resolve the object id from the identifier/id parameter

Declaration
public int? ResolveIdentifierParameter(string queryName, string parameterName)
Parameters
Type Name Description
string queryName

The query name

string parameterName

The parameter name

Returns
Type Description
int?

The object id, null for unknown payrun

ResolveNameParameter(string, string)

Resolve the object id from the name/id parameter

Declaration
public int? ResolveNameParameter(string queryName, string parameterName)
Parameters
Type Name Description
string queryName

The query name

string parameterName

The parameter name

Returns
Type Description
int?

The object id, null for unknown payrun

ResolveParameterEmployeeId()

Resolve the employee id from the parameter EmployeeId by id or identifier

Declaration
public int? ResolveParameterEmployeeId()
Returns
Type Description
int?

The employee id, null for unknown employee

ResolveParameterPayrollId()

Resolve the payroll id from the parameter PayrollId by id or name

Declaration
public int? ResolveParameterPayrollId()
Returns
Type Description
int?

The regulation id, null for unknown payroll

ResolveParameterPayrunId()

Resolve the payrun id from the parameter PayrunId by id or name

Declaration
public int? ResolveParameterPayrunId()
Returns
Type Description
int?

The regulation id, null for unknown payrun

ResolveParameterRegulationId()

Resolve the regulation id from the parameter RegulationId by id or name

Declaration
public int? ResolveParameterRegulationId()
Returns
Type Description
int?

The regulation id, null for unknown regulation

ResolveParameterUserId()

Resolve the user id from the parameter UserId by id or identifier

Declaration
public int? ResolveParameterUserId()
Returns
Type Description
int?

The employee id, null for unknown user

SetParameterAttribute(string, string, object)

Set report attribute value

Declaration
public void SetParameterAttribute(string parameterName, string attributeName, object value)
Parameters
Type Name Description
string parameterName

The parameter name

string attributeName

Name of the attribute

object value

The attribute value

SetReportAttribute(string, object)

Set report attribute value

Declaration
public void SetReportAttribute(string attributeName, object value)
Parameters
Type Name Description
string attributeName

Name of the attribute

object value

Attribute value

ToReportMessage(string)

Create report message

Declaration
public string ToReportMessage(string message)
Parameters
Type Name Description
string message

The error message

Returns
Type Description
string

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)
☀
☾
Back to top Generated by DocFX