Special Fields

Top  Previous  Next

Special Fields are texts enclosed in square brackets ([...........]). In layout mode they are available from drop-downs and can be inserted into the layout documents at the relevent position. A full list of available fields (there are hundreds) can be printed from Edit/Fields Report in the menu bar of the RTF Layout Editor.

 

When you run custom reports, the system replaces these fields with the appropriate values, and applies default formatting.

examples:

[Date]

[Amount]

[Postcode]

[Job Address]

 

Custom fields are not case sensitive

 

Formatting Special Fields

 

The system applies a default format to each field. For instance all date fields appear in Windows short date format as set in your Windows control panel

Sometimes, this is not appropriate

 

To format a special field, insert ">" plus a formatting string immediately after the special field name

for example,

 

[Date]                        prints        "26/05/04"

[Date>long date]        prints        "Wednesday 26th May 2004"

 

Format strings can be either Named or Built Up, and are either Numerical or Date/Time

 

Numerical

Named Strings

General Number Displays number with no thousand separator.
Currency Displays number with thousand separator, if appropriate; display two digits to the right of the decimal separator. Output is based on user's system settings.
Fixed Displays at least one digit to the left and two digits to the right of the decimal separator.
Standard Displays number with thousand separator, at least one digit to the left and two digits to the righseparator.
Percent Multiplies the value by 100 with a percent sign at the end.
Scientific Uses standard scientific notation.
Yes/NoAny nonzero numeric value is Yes. Zero is No.        
True/FalseAny nonzero numeric value is True. Zero is False.        
On/OffAny nonzero numeric value is On. Zero is Off.        

 

Built Up strings

0Digit placeholder; prints a trailing or a leading zero in this position, if appropriate.        
#Digit placeholder; never prints trailing or leading zeros.        
. Decimal placeholder.        
,Thousands separator.        
– + $ ( ) spaceLiteral character; characters are displayed exactly as typed into the format string.
^This character is replaced by asterix(*), since asterix itself is an invalid character within these strings

 

example if displaying 8315.4, then

 

00000.00 shows08315.40        
#####.##8315.4        
##,##0.008,315.40        
$##0.00$315.40
$0$8315
XXX$0.00XXX$8315.40
Total $0Total $8315
currency$8,315.40        

 

Date/Time

Named strings

General Date Shows date and time if expression contains both. If expression is only a date or a time, the missing information is not displayed. Date display is determined by user's system settings.
Long Date Uses the Long Date format specified by user's system settings.
Medium Date Uses the dd-mmm-yy format (for example, 03-Apr-93). Date display is determined by user's system settings.
Short Date Uses the Short Date format specified by user's system settings.
Long Time Displays a time using user's system's long-time format; includes hours, minutes, seconds.
Medium Time Shows the hour, minute, and "AM" or "PM" using the "hh:mm AM/PM" format.
Short Time Shows the hour and minute using the hh:mm format.

 

Built Up strings

       

d/m/y  shows        24/5/04        
dddd, mmmm dd, yyyyWednesday, May 24, 2004        
d-mmm        24-May        

               hh:mm AM/PM                09:45 AM

               d mmmm h:mm                24 May 9:45

 

Special Special Fields

 

If you enter invalid special fields ( because they don't exist in the RTF layout for the dropdowns for that report type), the system still tries to work it out.

 

Firstly, it tries to evaluate the special field as a formula. Thus

 

"[2+2]" will be evaluated as "4"

"[[Cost] *1.5]" will be evaluated as [Cost] + 50% if [Cost] is a valid special field

 

Secondly, it will create Job Variables if the special field does not exist. Thus

 

if "[Bath_Color]" is not a valid special field, the system will create a job variable, and ask for a value the first time you run the report.

 

The normal formatting rules apply:

"[2+2>Currency]" will be evaluated as "$4.00"

 

Nesting Special Fields

 

You can nest special fields within other special fields. Use this method to perform mathematical operations on special fields. Thus

 

[ [JUDF1] + [JUDF2] + [JUDF3] ] will produce the sum of JUDF1 to JUDF3 provided they are all numerical and the sum is non zero

 

Input Fields

 

If your report layout contains a field "[Input:whatever]", each time you run the report, it will stop and ask for a value.

The text after "[input:" is used as a prompt (in this case "whatever")

 

Toolbar Pictures

 

Databuild holds a number of internal pictures, used mainly for toolbars and command buttons. These can be retrieved using the format:

 

toolbar(xxxx)

 

where valid values of xxxx are:

 

all,about,paste,gst,bank,all_none,audit,backc,budget,forec,error,bank1,backup,bank2,balance,bank3,bank4,calculate,cc,chart,cascade,cheque,claim,clear,collapse,copy,date,cut,contact,color,connect,down,crystal,delete,docrtf,drag,document,docfixed,edit,estimate,email,exit,doorshut,expand,explode,export,factory,formatpara,formatchar,file,font,forc,feedback,fixed,frontend,forum,gl,global,gogogo,go,help,howdoi,import,invoice,inifile,journal,level,job,orphan,live,left,lock,glock,gunlock,new,macro,model,note,options,paid,order,ordsel,pay,per,phone,picture,post,printer,price,profile,page,psetup,pagebreak,pageheader,pagefooter,pageno,receipt,quote,register,recipe,refresh,reconcile,reprice,reverse,redo,right,report,save,saveas,sales,supplier,scale,search,sort,spellcheck,splat,standing,screen,stop,summary,table,template,tileh,takeoff,tab,tilev,tax,test,timesheet,transfer,up,variation,update,version,word,web,workup,undo,yes,xml,yearend,zip,log,wunlock,wcc,wmacro,worder,wworkup,wlock,ydelete,zoomin,zoomout,