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: 765,6301 ms
"
  6613 | 1 | |
Label


Using the "Engine" Object

We have already said that the “Engine” object represents the report's engine, which manages report construction. The process of arranging band(s) on a page can be managed by using the engine's properties and methods. First some theory.

The diagram below shows various dimensions of the report page.

_img242

The physical dimensions of the page are the “PaperWidth” and “PaperHeight” properties, visible in the object inspector when the page is selected. So the size of an A4 page is 210 x 297mm.

“PageWidth” and “PageHeight” are the dimensions of the printable region, which is usually less than the physical dimensions of the page. The size of the printable region is dependent on the report page properties “LeftMargin”, “TopMargin”, “RightMargin” and “BottomMargin”. The printable region’s size in pixels is returned by the “Engine.PageWidth” and “Engine.PageHeight” functions.

Finally, “FreeSpace” is the height of the free space on a page. If there is a "Page Footer" band on the page, its height is taken into account when calculating the “FreeSpace”. This height is returned in pixels by the “Engine.FreeSpace” function. Note that after displaying the next band the free space is reduced on the page, this is taken into account when calculating the “FreeSpace”.

How are report pages constructed? The FastReport core displays bands on a page as long as there is enough free space. When there is no more free space left the “Page Footer" band is printed (if required) and a new blank page is created. As already said, after displaying the next band the height of free space is reduced. Moreover, display of the next band begins from the current position, which is defined by coordinates on the X-axis and the Y-axis. The current position is returned by “Engine.CurX” and “Engine.CurY” respectively. After printing the next band, CurY automatically increases by the height of the printed band. After a new page is created “CurY” equals “0.” “CurX” is changed when printing multi-column reports.

“Engine.CurX” and “Engine.CurY” are available not only for reading but also for writing. This means that bands can be shifted by incrementing or decrementing these values. For example, in a report resembling this:

_img243

it can be printed in the following way:

_img244

This is achieved by writing a handler for the band's “OnBeforePrint” event:

 

procedure MasterData1OnBeforePrint(Sender: TfrxComponent);

begin

 Engine.CurX := Engine.CurX + 5;

end;

 

Changing “CurY” can make bands overlap, for example:

_img245

Achieved by this script:

procedure MasterData1OnBeforePrint(Sender: TfrxComponent);

begin

 Engine.CurY := Engine.CurY - 15;

end;

The “Engine.NewPage” method inserts a page break at any required point in a report, following which printing continues from the top of the new output page. In our example a break can be inserted after printing the second record:

procedure MasterData1OnAfterPrint(Sender: TfrxComponent);

begin

  if <Line> = 2 then

    Engine.NewPage;

end;

Note that we used the “OnAfterPrint” event (that is to say, after the band has been printed). Also note that the “Line” system variable returns the sequential number of the record.

The “Engine.NewColumn” method inserts a column break in multi-columned reports. If there are no more free columns left on the page then a new page is created.

Invoice with Payment Orders


The following example is presented on printout of orders and invoices with payment orders. They are available only for slovenian and croatian legislation. Such reports are '2U1 - Invoice - UPN - Form' for slovenian and '2U6 - Invoice - HUB 3A - Form' for croatian legislation. You can see design of these report opening from Report register.

We want to print payment order always at the bottom of the page. To force this behavior we set current vertical position (Engine.CurY) so that there is exact enough space to display report summary band on this page. 

First, check that there is enough space on the page. If it is not, let's get on the new page. Then, we specify the print position so that the payment order is always printed on the bottom edge of the page.

procedure PosebnaPoloznicaOnBeforePrint(Sender: TfrxComponent);
begin
   CallQRBeforeBandPrint(Sender, TfrxBand(sender).visible);
   if Engine.CurY >
     Engine.CurY + Engine.FreeSpace - PosebnaPoloznica.Height - 1 then
       Engine.NewPage;       
   Engine.CurY := Engine.CurY + Engine.FreeSpace - PosebnaPoloznica.Height - 1;
 end;

  

     


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