MasterData Band OnBeforePrint visibility issue

Hi to all [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I encountered one unusual Problem by changing the visibility Property of MasterData Band. So here my FR4 example. I want to print booklet style document and that for I prepared my data to be in correct order, so I do not need to do much in FR I have two datasets (Firebird SQL Query's): 1. Master Dataset 2. Detail Dataset Paper size = A5 Page 1 -> Only MasterData1 band of master dataset. The band is stretched over whole page. Page 2 -> Header1 HeaderChild1 MasterData2 (Detail Dataset) ChildMasterData1 Page 3 -> Empty page (placeholder) on Page 2 I define some Events:[/img]
Var chVIS: Boolean;                                        
  
procedure Header1OnBeforePrint(Sender: TfrxComponent);
begin
  chVIS:= <qDetailDataset."TYPE"> = 1;   // This changes for every new page. Same as when <Page#> is used (odd - even pages)
  Header1.Visible:= not chVIS;
  HeaderChild1.Visible:= chVIS;     
end;

procedure MasterData2OnBeforePrint(Sender: TfrxComponent);
begin
  ChildMasterData1.Visible:= chVIS;
  MasterData2.Visible:= not chVIS;                               
end;

Page 1 and Page 3 are printed correctly.
Page 2 - First side is OK but the problem begins on second side after MasterData2OnBeforePrint. I can not understand why but every first record on every other page beginning with page 2, FR prints opposite as expected. Other rows are correct on same page.
Example (second site):
1 Row - Printed MasterData2 Band !!! It should print ChildMasterData1
2 Row - Printed ChildMasterData1 .. Correct
3 Row - Printed ChildMasterData1 .. Correct

It seems that on first row the Visibility change is ignored !?
Do someone encountered this problem and do you know the solution for this?

Thanks in advance!

Comments

  • edited 9:02AM
    I found what is the problem ... its strange but global variable (Var chVIS: Boolean;) is not transferred as it should be.
    If I calculate the variable value in procedure then it works fine !?

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.