Class RVBaseFormattingService

The base class that must be implemented and returned by IRVFormattingProvider in order to be able to alter the format of a dashboard data.

Inheritance
System.Object
RVBaseFormattingService
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Reveal.Sdk
Assembly: Reveal.UI.Sdk.dll
Syntax
public class RVBaseFormattingService

Constructors

RVBaseFormattingService()

Declaration
public RVBaseFormattingService()

Methods

FormatAggregatedDate(DateTime, RVDashboardDataType, RVDashboardDateAggregationType, RVDateFormattingSpec)

Returns the formatted text representation for a given aggregated DateTime data.

Declaration
public virtual string FormatAggregatedDate(DateTime value, RVDashboardDataType type, RVDashboardDateAggregationType aggregation, RVDateFormattingSpec formatting)
Parameters
Type Name Description
System.DateTime value

The DateTime data

RVDashboardDataType type

The specific data type of the DateTime data

RVDashboardDateAggregationType aggregation

The specific period of time

RVDateFormattingSpec formatting

The formatting options set in the dashboard for this date value

Returns
Type Description
System.String

FormatDate(DateTime, RVDashboardDataType, RVDateFormattingSpec, Boolean)

Returns the formatted text representation for a given DateTime data with given formatting settings.

Declaration
public virtual string FormatDate(DateTime value, RVDashboardDataType type, RVDateFormattingSpec formatting, bool localTimeZone)
Parameters
Type Name Description
System.DateTime value

The DateTime data

RVDashboardDataType type

The specific data type of the DateTime data(Date, Time or DateTime )

RVDateFormattingSpec formatting

The formatting options for the specified data type

System.Boolean localTimeZone

The flag indicating whether the data is displayed in local time zone

Returns
Type Description
System.String

FormatFiscalQuarter(Int32, Int32)

This method would be invoked when fiscal year is configured for a date field and data is aggregated by quarter. The default implementation returns "FY [year]-Q[quarter]".

Declaration
public virtual string FormatFiscalQuarter(int year, int quarter)
Parameters
Type Name Description
System.Int32 year

The fiscal year value

System.Int32 quarter

The fiscal quarter value, starting from 1

Returns
Type Description
System.String

The given year and quarter formatted as fiscal year/quarter.

FormatFiscalSemester(Int32, Int32)

This method would be invoked when fiscal year is configured for a date field and data is aggregated by semester. The default implementation returns "FY [year]-H[semester]".

Declaration
public virtual string FormatFiscalSemester(int year, int semester)
Parameters
Type Name Description
System.Int32 year

The fiscal year value

System.Int32 semester

The fiscal semester value, starting from 1

Returns
Type Description
System.String

The given year and semester formatted as fiscal year/semester.

FormatFiscalYear(Int32)

This method would be invoked when fiscal year is configured for a date field and data is aggregated by year. The default implementation returns "FY [year]".

Declaration
public virtual string FormatFiscalYear(int year)
Parameters
Type Name Description
System.Int32 year

The fiscal year value

Returns
Type Description
System.String

The given year formatted as a fiscal year

FormatNumber(Double, RVNumberFormattingSpec, Boolean)

Returns the formatted text representation for a given numeric data with given formatting settings.

Declaration
public virtual string FormatNumber(double value, RVNumberFormattingSpec formatting, bool ignoreMkFormatting)
Parameters
Type Name Description
System.Double value

The numeric data

RVNumberFormattingSpec formatting

The formatting options for numeric data type

System.Boolean ignoreMkFormatting

The flag indicating whether to ignore the Million (M) and Thousand (K) formatting

Returns
Type Description
System.String

The text representation of the formatted numeric data

GetFieldEditorDefaultAggregatedDateFormats(RVDashboardDataType, RVDashboardDateAggregationType)

This method would be invoked when formatting options are needed to display a field editor for a date level, like Year or Quarter.

Declaration
public virtual List<string> GetFieldEditorDefaultAggregatedDateFormats(RVDashboardDataType type, RVDashboardDateAggregationType aggregation)
Parameters
Type Name Description
RVDashboardDataType type

The type of the field which default formats are needed for. Value could be Date, Time or DateTime.

RVDashboardDateAggregationType aggregation

The date aggregation level, could be Year, Quarter, Month, Day, Hour, Minute.

Returns
Type Description
System.Collections.Generic.List<System.String>

Returns a list with default date format strings to be used in the field editor date formatting options.

GetFieldEditorDefaultDateTimeFormats(RVDashboardDataType)

This method would be invoked when formatting options are needed to display a field editor for a non-aggregated date field, like when using the Grid visualization.

Declaration
public virtual List<string> GetFieldEditorDefaultDateTimeFormats(RVDashboardDataType type)
Parameters
Type Name Description
RVDashboardDataType type

The type of the field which default formats are needed for. Value could be Date, Time or DateTime.

Returns
Type Description
System.Collections.Generic.List<System.String>

Returns a list with default date format strings to be used in the field editor date formatting options.

GetFieldEditorDefaultSettings()

This method would be invoked, when the end user creates a new visualization and the settings returned would be used as default field settings.

Declaration
public virtual RVFieldEditorDefaultSettings GetFieldEditorDefaultSettings()
Returns
Type Description
RVFieldEditorDefaultSettings

Returns a settings object containing default settings the field editor will use.