Text formatting options for data fields in a Report

Article No

Q0014

Version Applicability

PERKS 2.45 and later

Last Reviewed On

June 21, 2000

SYMPTOM:

Often, you need to apply formatting Attributes to the fields of information that appear in your Report. Sometimes, these serve ornamental purposes. At other times, they become almost a necessity depending on the implementation. This Article discusses the nature of formatting Attributes. (For preliminary Help on how to create Report designs, please refer to the PERKS Online Help.)

RESOLUTION:

Let us assume that you have your Report design opened (through the Report Writer only). You have a field of information - presently selected. Press [Ctrl+M], or choose Edit / Properties from the menu of the Report Writer window. Otherwise, you can also apply these Attributes at the time adding the field. The Picture of Format and its Width is automatically inserted by the System. However, you can override it. For a field of information, following are the operations that you can perform on its formatting Attributes.

  • Modifying the width of field

This is the amount of space, in number of character positions, being allocated for displaying or printing the field. By default, it equals the length of the field as indicated in the interface for entry into the System. If you can remember or know that all of your entries occupy much less space than allocated, you might decide to change the picture of Format and the Width.

  • Replacing specific characters (with some other characters)

Suppose the content of a field for an employee is "12_12_123_1234", which some people may prefer to be printed like "12-12-123-1234". You do need to modify all your entries. In your Report, just use this feature and specify:

Replace _ with -

Enter the characters '_' and '-', respectively, in the textboxes provided against the Replace option.

Consider another example: The content of a field is like 123456-12-1234 that you want to be printed like 123456 12 1234. Here is how specify the attribute:

Replace - with &b&

Remember to flank the character b with the two ampersands, which confirms the System that you are not making a blank entry and indeed wish to print <blank>.

  • Removing specific characters

The content of a field is: 12-12-123-1234. You want to print it in the following form: 12121231234. So what you need is to remove all instances of the character '-'. You can consider this situation as a special instance of replacing a character with a null or void.

  • Padding with a specific character

You can choose to left-fill unused character positions from the allocated space for a field as designated by its Width, so the output appears 'justified'. For example, if the Width of a numeric field is 999999.99 and the content of the field for an employee is 3000.00, instead of printing 3000.00, you can instruct the system to print it in the form: 003000.00. To do this turn on the checkbox labelled Padding and specify the character (any alphanumeric character) in the following textbox labelled Padded by.

  • Specifying the 'case' of field

For text information, you may opt to decide its case of presentation in the Report design. Here, you have four options, as under:

- Default        : No change

- Upper           : All in capital letters

- Lower           : All in small letters

- Sentence     : First letter in upper case

For numeric fields, this feature will not have any effect

  • Printing Value or ordinal number for a List type field

PERKS allows to define fields that appear as drop-down lists in the entry interface. In your Report, you have the freedom the express the ordinal option number or the specific text against the chosen value. This option is only for use with List type fields. So unless the presently selected is of that type, this option is not available. To specify your choice, just select one of the two options labelled Value and Number. You need not bother about its Format and Width as you change the Print option (Number or Value).

  • Font

The way you can exploit this feature is only limited by your own imagination. However, we advise you against being choosy about fonts in case the printing capability of the printer is limited. If you will be printing a design on a dot-matrix printer, you should:

- set print mode as: Text (in Page Layout option),  and

- adhere to the following:

- Font Name : Courier New

- Font Size    : 10 points (one point = 1/72 ")

- Font Style   : Normal (avoid Bold / Italic styles)

Otherwise, print your Report on Printers with graphic capabilities like an Inkjet or Laser Printer, so you can save your design with a graphic page layout and overcome these restrictions.

  • Forecolor (color of text) and Backcolor (color of background)

You can specify Forecolor and Backcolor of any field. You can use the color palette to choose the desired shade. You can compose new shades also, all by yourself.

The color is depicted as a number (RGB code). Every color is a combination of the three basic color, viz., Red, Green and Blue (RGB). The System tracks each shade as a combination of these three basic colors, such that the intensity of each primary color can vary on a scale of 0 to 255 (so 256 different values are possible). A zero indicates darkness or lack of intensity. So, a color with composed Red = 255, Green = 255 and Blue = 255 will have an RGB code as (256 x 256 x 256) -1 = 16777215. With all the color component being present at full intensity, this shade is 'white'. It is the default Backcolor of all fields. Similarly, with Red = 0, Green = and Blue = 0, the shade will be 'black'. The RGB Code for the shade 'green' will be composed of Red = 0, Green = 255 and Blue = 0. Its RGB code will be 256*255 = 65280. Likewise, that for 'blue' will be 16711680 (256*256*255).


 
 

Disclaimer:
The information provided in the list of Knowledge-Base Articles are provided on an As-Is basis without warranty of any kind, either expressed or implied, including warranties of merchantability and fitness for a particular purpose. In noevents shall FACT Software International Pte Ltd or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if FACT Software International Pte Ltd or its suppliers have been advised of the possibility of such damages. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. All third party trademarks are the property of their respective owners.

Copyright © 2011 FACT Software International Pte Ltd