by jackie on Thu Jun 03, 2010 3:46 pm
1. From the Report Writer - Design view, create a new variable.
2. Click on 'Calc' tab and go to the Report Bands. The windows in the right shows the variables associated with the selected Item in the Report Bands.
3. The first step is to assign the value of the variable and return its value.To set Value in the field named Value. To set Value to something the ' := ' (colon & equal) is used.
4. All available GPS functions including "GPSCubeDate2DateTime" can be found on the "Code Toolbox:Language" section and these GPS functions can be used in your variable code/procedure by clicking the field and dragging it into the variable code.
Here are some good examples for TimeFrame(Calendar or Fiscal) Functions:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GPSViewTimeframeCount (integer) - returns the number of timeframes in the view. This should be used for error handling purposes. For example:
if (GPSViewTimeframeCount > 0) then do something
GPSViewIsTimeframeCalendar (Boolean) - returns if a given timeframe is a calendar timeframe or fiscal timeframe.
if (GPSViewTimeframeCount > 0) then
result := GPSViewIsTimeframeCalendar(0);
GPSViewTimeframeCalendarFromDate (TDateTime) - returns a given timeframe's from date (assuming it is calendar) - it is your responsibility to handle if a timeframe is calendar or not.
if (GPSViewTimeframeCount > 0) then
if GPSViewIsTimeframeCalendar(0) then
result := GPSViewTimeframeCalendarFromDate(0);
GPSViewTimeframeCalendarToDate (TDateTime) - returns a given timeframe's to date (assuming it is calendar) - it is your responsibility to handle if a timeframe is calendar or not.
if (GPSViewTimeframeCount > 0) then
if GPSViewIsTimeframeCalendar(0) then
result := GPSViewTimeframeCalendarToDate(0);
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hoe this helps.
Jackie
Davis Controls