Search code examples
pascalscriptfastreport

How to get a height of the full data from MasterData (FastReport template)?


I wanna get a Height of MasterData whith full generated data. Normally i use on event onAfterCalcHeight of MasterData

 if engine.FreeSpace <= GroupHeader2.Height  + MasterData1.Height  then
engine.NewPage;

.I need Above line of code, because my template cut of Data beetwen pages.


Solution

  • The problem here was the order of events.

    First i create a global double variables, for full masterdata1.Height and another height-variable components.

    var  
    masterdata_Height,GroupHeader2_Height: double;
    

    Next on masterdata event OnAfterCalcHeight a simple

      masterdata_Height:=masterdata.Height;
    

    Same whith another FastReport headers.

    After this on All Headers Event OnBeforePrint I add a condition :

    if engine.FreeSpace <= (masterdata_Height + GroupHeader2_Height)  then
    engine.NewPage;
    

    In parentheses condition adds all sizes headers approaching the headline event.