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]
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!
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
If I calculate the variable value in procedure then it works fine !?