Skip to content

DevExpress-Examples/winforms-dashboard-calculate-fiscal-functions-for-date-time-data-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

Dashboard for WinForms - How to Calculate Fiscal Functions for Date-Time Data Fields

This example shows how to create and register custom functions that calculate the fiscal year, quarter, and week from date-time data fields.

Overview

In this example, the Grid dashboard item displays the fiscal year, quarter, and week for the corresponding date.

SalesDynamics

The following expressions calculate fiscal values for the corresponding date:

Calculated Field Expression
Fiscal Year GetFiscalYear([OrderDate])
Fiscal Quarter GetFiscalQuarter([OrderDate])
Fiscal Week of Year GetFiscalWeekOfYear([OrderDate])

The following code snippet shows how to register fiscal functions:

C# code:

CriteriaOperator.RegisterCustomFunction(new GetFiscalYearFunction([first day of year], [first month of year])); CriteriaOperator.RegisterCustomFunction(new GetFiscalQuarterFunction([first day of year], [first month of year])); CriteriaOperator.RegisterCustomFunction(new GetFiscalWeekOfYearFunction([first day of year], [first month of year], [CalendarWeekRule showing how to define the first week], [The first day of week]));

VB code:

CriteriaOperator.RegisterCustomFunction(New GetFiscalYearFunction((first day [of] year), (first month [of] year))) CriteriaOperator.RegisterCustomFunction(New GetFiscalQuarterFunction((first day [of] year), (first month [of] year))) CriteriaOperator.RegisterCustomFunction(New GetFiscalWeekOfYearFunction((first day [of] year), (first month [of] year), (CalendarWeekRule showing how [to] define the first week), (The first day [of] week))) 

Documentation

About

This example shows how to add fiscal functions to the WinForms Dashboard in a client mode.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •