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
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

  • edited 10:28AM
    gavind wrote: »
    Hi Katsumoto, looks like this is an uncommon issue. You might want to create a support ticket on this too.

    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?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.