Обработка событий отчета по ресурсам Назад В начало Вперед
var
  PageHdr: variant;
  lastLine: variant;
  curLineColor: variant;
  evenLineColor: variant;
  oddLineColor: variant;
  colorItems: array [0..41] of variant;

procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);
begin
  with PageHeader1, Engine do
  begin
  if <TOTALPAGES> = <PAGE#> then
	PageHdr := 'Окончание справки по проектам на '
  else
	PageHdr := 'Продолжение справки по проектам на ';
end
  end
;

procedure Memo32OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo32, Engine do
  begin
  if <PROJECTSDS."PRJLEVEL"> > 0 then
	Visible := False
  else
	Visible := True;
  end
end;

procedure Memo33OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo33, Engine do
  begin
  if <PROJECTSDS."PRJLEVEL"> > 0 then
	Visible := False
  else
	Visible := True;
  end
end;

procedure DetailHeader1OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailHeader1, Engine do
  begin
  if CheckBox2.Checked then
	visible := false
  else
	visible := true;

  if (DetailHeader1.Height + DetailData1.Height) > FreeSpace then NewPage;
  end
end;

procedure DetailData1OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailData1, Engine do
  begin
  lastLine := <LINE#>;
  if <LINE#> Mod 2 = 0 then
	curLineColor := evenLineColor
  else
	curLineColor := oddLineColor;

  if CheckBox2.Checked then
	visible := false
  else
	visible := true;
  end
end;

procedure Memo20OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo20, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo9OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo9, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo10OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo10, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo7OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo7, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo11OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo11, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo12OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo12, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo13OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo13, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure DetailFooter1OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailFooter1, Engine do
  begin
  if lastLine Mod 2 = 0 then
	curLineColor := oddLineColor
  else
	curLineColor := evenLineColor;

  if CheckBox2.Checked then
	visible := false
  else
	visible := true;
end
  end
;

procedure Memo36OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo36, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo35OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo35, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo34OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo34, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Child1OnBeforePrint(Sender: TfrxComponent);
begin
  with Child1, Engine do
  begin
  if CheckBox1.Checked then
	visible := true
  else
	visible := false;
end
  end
;

procedure DetailHeader2OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailHeader2, Engine do
  begin
  if CheckBox2.Checked then
	visible := false
  else
	visible := true;

  if (DetailHeader2.Height + DetailData2.Height) > FreeSpace then NewPage;
  end
end;

procedure DetailData2OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailData2, Engine do
  begin
  lastLine := <LINE#>;
  if <LINE#> Mod 2 = 0 then
	curLineColor := evenLineColor
  else
	curLineColor := oddLineColor;

  if CheckBox2.Checked then
	visible := false
  else
	visible := true;
  end
end;

procedure Memo26OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo26, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo22OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo22, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo23OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo23, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo24OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo24, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo25OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo25, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure DetailFooter2OnBeforePrint(Sender: TfrxComponent);
begin
  with DetailFooter2, Engine do
  begin
  if lastLine Mod 2 = 0 then
	curLineColor := oddLineColor
  else
	curLineColor := evenLineColor;

  if CheckBox2.Checked then
	visible := false
  else
	visible := true;
  end
end;

procedure Memo37OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo37, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo39OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo39, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Memo38OnBeforePrint(Sender: TfrxComponent);
begin
  with Memo38, Engine do
  begin
  Color := curLineColor;
  end
end;

procedure Child2OnBeforePrint(Sender: TfrxComponent);
begin
  with Child2, Engine do
  begin
  if CheckBox1.Checked then
	visible := true
  else
	visible := false;
end
  end
;

procedure Page2OnBeforePrint(Sender: TfrxComponent);
begin
  with Page2, Engine do
  begin
  ComboBox1.ItemIndex := 15;
  Label1.Color := clAqua;
  evenLineColor := clAqua;
  ComboBox2.ItemIndex := 41;
  Label2.Color := clInfoBk;
  oddLineColor := clInfoBk;
  end
end;

procedure CheckBox2OnBeforePrint(Sender: TfrxComponent);
begin
  with CheckBox2, Engine do
  begin
  if CheckBox2.Checked then
	CheckBox1.Checked := false;
  end
end;

procedure CheckBox1OnBeforePrint(Sender: TfrxComponent);
begin
  with CheckBox1, Engine do
  begin
  if CheckBox1.Checked then
	CheckBox2.Checked := false;
  end
end;

procedure ComboBox1OnBeforePrint(Sender: TfrxComponent);
begin
  with ComboBox1, Engine do
  begin
  colorItems[0] := clWhite;
  colorItems[1] := clBlack;
  colorItems[2] := clMaroon;
  colorItems[3] := clGreen;
  colorItems[4] := clOlive;
  colorItems[5] := clNavy;
  colorItems[6] := clPurple;
  colorItems[7] := clTeal;
  colorItems[8] := clGray;
  colorItems[9] := clSilver;
  colorItems[10] := clRed;
  colorItems[11] := clLime;
  colorItems[12] := clYellow;
  colorItems[13] := clBlue;
  colorItems[14] := clFuchsia;
  colorItems[15] := clAqua;
  colorItems[16] := clTransparent;
  colorItems[17] := clScrollBar;
  colorItems[18] := clBackground;
  colorItems[19] := clActiveCaption;
  colorItems[20] := clInactiveCaption;
  colorItems[21] := clMenu;
  colorItems[22] := clWindow;
  colorItems[23] := clWindowFrame;
  colorItems[24] := clMenuText;
  colorItems[25] := clWindowText;
  colorItems[26] := clCaptionText;
  colorItems[27] := clActiveBorder;
  colorItems[28] := clInactiveBorder;
  colorItems[29] := clAppWorkSpace;
  colorItems[30] := clHighlight;
  colorItems[31] := clHighlightText;
  colorItems[32] := clBtnFace;
  colorItems[33] := clBtnShadow;
  colorItems[34] := clGrayText;
  colorItems[35] := clBtnText;
  colorItems[36] := clInactiveCaptionText;
  colorItems[37] := clBtnHighlight;
  colorItems[38] := cl3DDkShadow;
  colorItems[39] := cl3DLight;
  colorItems[40] := clInfoText;
  colorItems[41] := clInfoBk;
  evenLineColor  := colorItems[ItemIndex];
  Label1.Color   := evenLineColor;
  end
end;

procedure ComboBox2OnBeforePrint(Sender: TfrxComponent);
begin
  with ComboBox2, Engine do
  begin
  colorItems[0] := clWhite;
  colorItems[1] := clBlack;
  colorItems[2] := clMaroon;
  colorItems[3] := clGreen;
  colorItems[4] := clOlive;
  colorItems[5] := clNavy;
  colorItems[6] := clPurple;
  colorItems[7] := clTeal;
  colorItems[8] := clGray;
  colorItems[9] := clSilver;
  colorItems[10] := clRed;
  colorItems[11] := clLime;
  colorItems[12] := clYellow;
  colorItems[13] := clBlue;
  colorItems[14] := clFuchsia;
  colorItems[15] := clAqua;
  colorItems[16] := clTransparent;
  colorItems[17] := clScrollBar;
  colorItems[18] := clBackground;
  colorItems[19] := clActiveCaption;
  colorItems[20] := clInactiveCaption;
  colorItems[21] := clMenu;
  colorItems[22] := clWindow;
  colorItems[23] := clWindowFrame;
  colorItems[24] := clMenuText;
  colorItems[25] := clWindowText;
  colorItems[26] := clCaptionText;
  colorItems[27] := clActiveBorder;
  colorItems[28] := clInactiveBorder;
  colorItems[29] := clAppWorkSpace;
  colorItems[30] := clHighlight;
  colorItems[31] := clHighlightText;
  colorItems[32] := clBtnFace;
  colorItems[33] := clBtnShadow;
  colorItems[34] := clGrayText;
  colorItems[35] := clBtnText;
  colorItems[36] := clInactiveCaptionText;
  colorItems[37] := clBtnHighlight;
  colorItems[38] := cl3DDkShadow;
  colorItems[39] := cl3DLight;
  colorItems[40] := clInfoText;
  colorItems[41] := clInfoBk;
  oddLineColor   := colorItems[ItemIndex];
  Label2.Color   := oddLineColor;
  end
end;

begin

end.