PANTHEON™ Help

 Toc
 Početna stranica - PANTHEON uputstva
[Collapse]PANTHEON
 [Collapse]PANTHEON priručnici
  [Expand]Vodič po Datalab PANTHEON FarmAccounting
  [Expand]Vodič po PANTHEON Retail
  [Expand]Vodič po DataLab PANTHEON™
  [Expand]Vodič po PANTHEON VET
 [Collapse]PANTHEON korisnički priručnici
  [Expand]Korisnički priručnik za DataLab PANTHEON
  [Expand]Korisnički priručnik za PANTHEON Vet
  [Expand]Korisnički priručnik za PANTHEON Maloprodaju
  [Expand]Korisnički priručnik za PANTHEON Farming
[Collapse]PANTHEON Web
 [Collapse]Vodiči po PANTHEON Web
  [Expand]Vodič za PANTHEON Web Terminal
  [Expand]Vodič po PANTHEON Web Light
  [Expand]Vodič za PANTHEON Web Legal
  [Expand]Arhiva starih proizvoda
 [Collapse]Korisnički priručniki za PANTHEON Web
  [Expand]Kako započeti s programom PANTHEON Web
  [Expand]Korisnički priručnik za PANTHEON Web Light
   Korisnički priručnik za PANTHEON Web Terminal
  [Expand]Korisnički priručnik za PANTHEON Web Legal
  [Expand]Arhiva starih proizvoda
[Collapse]PANTHEON Granule
 [Collapse]Vodič za PANTHEON Granule
  [Expand]Granula Kadrovi
  [Expand]Granula Putni nalozi
  [Expand]Granula Dokumenti i zadaci
  [Expand]Granula Nadzorna ploča
  [Expand]Granula B2B naručivanje
  [Expand]Granula Servis na terenu
  [Expand]Inventar Fiksne Imovine Granula
  [Expand]Granula Inventura skladišta
 [Collapse]Korisnički priručnik za PANTHEON Granule
   Početak
   Primjer korištenja PANTHEON Granula u fiktivnom preduzeću
  [Expand]PANTHEON Granule i aktivacija
  [Expand]Granula Kadrovi
  [Expand]Granula Putni nalozi
  [Expand]Granula Dokumenti i zadaci
  [Expand]Granula B2B Naručivanje
  [Expand]Granula Nadzorna ploča
  [Expand]Granula Servis na terenu
   PANTHEON Granule - česta pitanja i odgovori
  [Expand]Inventar Fiksne Imovine Granula
  [Expand]Inventar u skladištu granula
  [Expand]Arhiva
[Collapse]Korisničke stranice
  Test 2
  Test 3
  Test 5
  TEST_Kreiranje noveg zaposlenika 1000003067
  TEST_Kreiranje noveg zaposlenika 1000003067-MK
  TEST3_Kreiranje novog dokumenta 1000003410-SL
  TEST2_Uređivanje kontaktnih podataka 1000003415-SL
  Test
 [Collapse]Test za CG
   Test podređeni 1
  TEST_Kreiranje noveg zaposlenika 1000003067-BA
  TEST_Kreiranje novog zaposlenika 1000003067-SR
  TEST_Kreiranje noveg zaposlenika 1000003067_EU_ORIG
 [Collapse]Pantheon hosting
  [Expand]Hosting robot
  [Expand]DEMO hosting
  Porez ( cookies )
 [Collapse]Prijava na korisničke stranice
   Registracija za Pantheon korisnike
   Glavna stranica
   Prva posjeta korisničkom sajtu
  Novosti
  Uvod u Wiki
  Upute za stranicu izbornika
 [Collapse]Potpora
  [Expand]Tehnička podrška
   Podrška na daljinu za Host korisnike
  [Expand]Daljinska podrška
  Kako upotrebljavam i dopunjujem wiki ?
 [Collapse]Pomoć
   Pantheon Hosting
   Uporedba verzija pantheona
  [Expand]Dokumentacija
   Vsa navodila
   Video uputstva
   Video novosti
   Pitaj druge korisnike
   Postanite PANTHEON svetovalec
   Sve vijesti
   Svi događaji
   Pregled opomb i planova
   Plan
 [Collapse]Informacije
   Obavijesti
  [Expand]Nastavitev deviznih tečajev
 [Collapse]Moji podaci
   Ugovor o osvježavanju
   Podaci o kompaniji
  [Expand]Pooblaščene osobe
   Dovoljenja
   Lični podaci
   Kontaktni podatci
   Osveževalna pogodba
 [Collapse]Forum
   Spremljanje foruma
 [Collapse]Video
   Instruktivni videozapisi
   Video Ažuriranja
  Portal za razvijače
  Tržnica
 [Collapse]Wiki uputstva
  [Expand]Uvod u wiki
  [Expand]Pretraga po Wikiju
  [Expand]Uređenje Wiki-a
   Pripenjanje dokumentov

Load Time: 359,3765 ms
"
  6613 | 1 | |
Label


Formatting of Values

A feature of aggregate functions is that the returned numerical values are not formatted, as shown by the first example, which uses “SUM”:

_img141

Data fields usually return a formatted value, which is simply displayed by the “Text” object without any change. To apply formatting to the “SUM” result, let's use the value formatting tools in FastReport.

Select the object containing the Sum and open the format editor either from 'Display Format...' in its context menu or through the “DisplayFormat” property in the Object Inspector.

clip0181

This editor lists the format categories on the left, the corresponding formats on the right and the format string and decimal separator for the selected category and format below. We’ll select the “Number” category and "$1,234.50" format. The format string is an argument for the Delphi "Format" function, which FastReport uses to implement number formatting. The format string and decimal separator can be changed. If the decimal separator is left blank then the current regional setup value is used.

After clicking ОK and previewing the report you will see that the Sum in the report is now formatted correctly:

_img143

Note the combobox at the top of the dialogue form. If we have more than one expression in an object, we may set different formatting for each expression.

Inline formatting allows you to set different formatting for each expression contained in the object. It was used in previous versions of FastReport. Now it is obsolete (use the formatting dialogue to set different formatting for each expression).

 

Using the example, re-size the footer and its object and change the object text to this:

 

Total: [SUM(<Group."ItemsTotal">,MasterData1)]

Number: [COUNT(MasterData1)]

 

The total and the number of orders will be displayed in the object.

 

In the report preview both of these values are shown in monetary format, which we had previously set. This is incorrect:

 

_img144

 

To display each value in its correct format they need to be formatted individually. To do this we use format tags, which are placed just before the closing square bracket of the expression. In our example, disable formatting for the object (select “Text (no formatting)” category in the format editor). Now we need to specify the format for just the first expression, as the second one will be displayed correctly by default (i.e. as an integer). Change the object text as follows:

 

Sum: [SUM(<Group."ItemsTotal">,MasterData1) #n%2,2m]

Number: [COUNT(MasterData1)]

 

Preview the report to make sure that the object is displayed correctly:

 

_img145

 

The general syntax of format tags is:

 

[expression #formattag]

 

Note that the space character between the expression and the “#” symbol is mandatory! The format tag itself might look like:

 

#nformat_string – numerical format

#dformat_string – date/time format

#bFalse,True – boolean format

 

Format_string in each case is the argument to the function used for formatting. So, for numerical formatting the Delphi Format function is used, and for date/time the FormatDateTime function. The syntax for these functions can be found in the Delphi help system. Below are several values used in FastReport:

 

for numerical formatting:

%g – number with the minimal places after the decimal point

%2.2f – number with a fixed number of places after the decimal point

%2.2n – as previous, but with thousands separator

%2.2m – monetary format, accepted by the Windows OS, dependent on the regional settings in the control panel

 

for date/time formatting:

dd.mm.yyyy – date as '23.12.2003'

dd mmm yyyy – date as '23 Nov 2003'

dd mmmm yyyy – date as '23 November 2003'

hh:mm – time as '23:12'

hh:mm:ss – time as '23:12:00'

dd mmmm yyyy, hh:mm – date and time as '23 November 2003, 23:12'

 

A comma or a dash can be used instead of the dot in the format_string for numerical formatting. This symbol is used as the separator between the integer and the fractional parts of the value. Any other character is not allowed.

 

For formatting with the “#b” type (boolean), the format_string is entered as two values separated by a comma. The first value corresponds to “False” and the second to “True”.

 

  

     


Rate this topic
Was this topic usefull?
Comments
Comment will also bo visible in forum!