Problem no duplicate half of page (TfrxSysMemo)
well, in this reports what i originally needed was to duplicate half of the page in the other half of it
first of all i couldnt find anything about this in the documentation, so it would be great if the devs
put this on it,
i searched in the forum and over the web and founded only a few refs [Topic in this forum]
anyway, after a few hours i managed to do what i want it, using this piece of code
basically, what this piece does is duplicate header, masterdata and footer on the other half of the page, i attached a example
now to the problem, the footer have tree TfrmSysMemo and when i duplicate on the other half of the page it looks like their
reset or something, couse their original value gone,
is there a solution for this behaviour?
first of all i couldnt find anything about this in the documentation, so it would be great if the devs
put this on it,
i searched in the forum and over the web and founded only a few refs [Topic in this forum]
anyway, after a few hours i managed to do what i want it, using this piece of code
var FCriaNovaPagina : Boolean;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
             Â
procedure GroupHeader_1viaOnBeforePrint(Sender: TfrxComponent);
var OriginalY : Extended;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
begin
  if(FCriaNovaPagina) then
    begin
      Engine.NewPage();                                                         Â
      FCriaNovaPagina := True;                                         Â
    end;             Â
  try
    GroupHeader_1via.OnBeforePrint := nil;
    OriginalY := Engine.CurY;                                                     Â
    Engine.ShowBand(GroupHeader_1via);
    Engine.CurY := Engine.CurY + (Engine.PageHeight / 2) - GroupHeader_1via.Height;                                                                         Â
    Engine.ShowBand(GroupHeader_1via);           Â
    Engine.CurY := OriginalY;                                             Â
  finally
    GroupHeader_1via.OnBeforePrint := 'GroupHeader_1viaOnBeforePrint';                                                                                                 Â
  end;             Â
end;Â Â Â Â
   Â
procedure MasterData_1viaOnBeforePrint(Sender: TfrxComponent);
var OriginalY : Extended;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
begin               Â
  try
    MasterData_1via.OnBeforePrint := nil;
    OriginalY := Engine.CurY;                                                     Â
    Engine.ShowBand(MasterData_1via);
    Engine.CurY := Engine.CurY + (Engine.PageHeight / 2) - MasterData_1via.Height;
    Engine.ShowBand(MasterData_1via);
    Engine.CurY := OriginalY;                                 Â
  finally
    MasterData_1via.OnBeforePrint := 'MasterData_1viaOnBeforePrint';                                                                                                 Â
  end;
end;Â Â
procedure GroupFooter_1viaOnBeforePrint(Sender: TfrxComponent);
var OriginalY : Extended;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
begin
  FCriaNovaPagina := True;               Â
  try
    GroupFooter_1via.OnBeforePrint := nil;
    OriginalY := Engine.CurY;                                                     Â
    Engine.ShowBand(GroupFooter_1via);
    Engine.CurY := Engine.CurY + (Engine.PageHeight / 2) -  GroupFooter_1via.Height;
    Engine.ShowBand(GroupFooter_1via);
    Engine.CurY := OriginalY;           Â
  finally
    GroupFooter_1via.OnBeforePrint := 'GroupFooter_1viaOnBeforePrint';                                                                                                 Â
  end;
end;
begin
  FCriaNovaPagina := False;                                                                     Â
end.
basically, what this piece does is duplicate header, masterdata and footer on the other half of the page, i attached a example
now to the problem, the footer have tree TfrmSysMemo and when i duplicate on the other half of the page it looks like their
reset or something, couse their original value gone,
is there a solution for this behaviour?
Comments
thx for ur reply, i fixed the problem but idk if this behaviour should be made natively or it was my mistake
what i made was put another event to work GroupFooter_1viaOnAfterPrint and that fixed the problem,
so instead of duplicate my footer on OnBeforePrint event now it duplicates on OnAfterPrint event.
it looks like when OnBeforePrint event is fired up the TfrxSysMemo didnt calcuted the totals yet so switching
to OnAfterPrint the TfrxSysMemo had already his correct value.
thats correct? should i still open a ticked for this one?