<TfrxReport Version="4.7.79" DotMatrixReport="False" IniFile="\Software\Fast Reports" OldStyleProgress="True" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="39885,6569446181" ReportOptions.Description.Text="" ReportOptions.LastChange="39900,4057095255" ScriptLanguage="PascalScript" ScriptText.Text="var
CalendarStartDate: TDateTime;
DayLeft,DayTop,DayWidth,DayHeight,DayTaskCount: Extended;
function StartOfTheMonth(const AValue: TDateTime): TDateTime;
var
LYear, LMonth, LDay: Word;
begin
DecodeDate(AValue, LYear, LMonth, LDay);
Result := EncodeDate(LYear, LMonth, 1);
end;
procedure CalendarOnBeforePrint(Sender: TfrxComponent);
var
Row: Integer;
begin
CalendarStartDate := 0;
DayWidth := Engine.PageWidth / 7;
if MonthOf(<Months."FirstDay"> + 35) <> MonthOf(<Months."FirstDay"> + 7) then
Row := 5
else
Row := 6;
DayHeight := (Engine.PageHeight - 140) / Row;
DayTaskCount := (DayHeight - 17) div 12;
end;
procedure CalHeaderOnBeforePrint(Sender: TfrxComponent);
begin
if CalendarStartDate = 0 then
CalendarStartDate := <Months."FirstDay">
else
begin
CalendarStartDate := StartOfTheMonth(CalendarStartDate + 42);
CalendarStartDate := CalendarStartDate - DayOfWeek(CalendarStartDate - <FirstDayOfWeek> + 5) mod 7;
end;
end;
procedure CalDayOnAfterData(Sender: TfrxComponent);
var
D: TDateTime;
begin
D := CalendarStartDate + <Line> - 1;
with TfrxMemoView(Sender) do
begin
if MonthOf(D) <> MonthOf(CalendarStartDate + 7) then
Text := ''
else
begin
Text := IntToStr(DayOf(D));
if 1 shl ((DayOfWeek(D) + 5) mod 7) and <WorkDays> = 0 then
Font.Color := clRed
else
Font.Color := clWindowText;
end;
if (Text <> '') and (TaskCount(D) > 0) then
Color := $D0D0D0
else
Color := clNone;
end;
end;
procedure WeekDayOnBeforePrint(Sender: TfrxComponent);
begin
if <Line> = 1 then
DayTop := Engine.CurY + 20
else
Engine.CurY := DayTop - 20;
TfrxMemoView(Sender).Left := (<Line> - 1) mod 7 * DayWidth;
TfrxMemoView(Sender).Width := DayWidth;
end;
procedure DateOnBeforePrint(Sender: TfrxComponent);
begin
if (<Line> mod 7 = 1) and (<Line> <> 1) then
DayTop := DayTop + DayHeight;
Engine.CurY := DayTop;
DayLeft := (<Line> - 1) mod 7 * DayWidth;
with TfrxMemoView(Sender) do
begin
Left := DayLeft;
Width := DayWidth;
if (<Line> = 1) or (StartOfTheMonth(<Days."Day">) = <Days."Day">) then
DisplayFormat.FormatStr := 'd mmmm'
else
DisplayFormat.FormatStr := 'd';
if 1 shl ((DayOfWeek(<Days."Day">) + 5) mod 7) and <WorkDays> = 0 then
Font.Color := clRed
else
Font.Color := clWindowText;
end;
end;
procedure DayOnBeforePrint(Sender: TfrxComponent);
begin
with TfrxMemoView(Sender) do
begin
Left := DayLeft;
Width := DayWidth;
Height := DayHeight - 17;
if MonthOf(<Days."Day">) <> MonthOf(<Months."FirstDay"> + 7) then
Color := $EEEEEE
else
Color := clNone;
end;
end;
procedure TaskOnBeforePrint(Sender: TfrxComponent);
var
X: Integer;
begin
if <Line> = 1 then
Engine.CurY := DayTop + 17;
with TfrxMemoView(Sender) do
begin
Visible := <Line> <= DayTaskCount;
if <Line> > DayTaskCount then
Engine.CurY := DayTop;
Left := DayLeft + 2;
Width := DayWidth - 4;
Color := <DayTasks."BackgroundColor">;
X := 1;
if <DayTasks."Priority.Img"> <> '' then
X := X + 12;
if <DayTasks."Completion.Img"> <> '' then
X := X + 11;
ParagraphGap := X;
if <DayTasks."AllDay"> then
begin
Frame.Color := clBlack;
Text := '[DayTasks."Title"]';
end
else
begin
Frame.Color := clWindow;
Text := '[DayTasks."CompactTimeStr"] [DayTasks."Title"]';
end;
end;
end;
procedure PriorityImgOnBeforePrint(Sender: TfrxComponent);
begin
with TfrxPictureView(Sender) do
begin
Visible := <Line> <= DayTaskCount;
Left := DayLeft + 4;
Color := <DayTasks."BackgroundColor">;
end;
end;
procedure CompletionImgOnBeforePrint(Sender: TfrxComponent);
begin
with TfrxPictureView(Sender) do
begin
Visible := <Line> <= DayTaskCount;
if <DayTasks."Priority.Img"> = '' then
Left := DayLeft + 5
else
Left := DayLeft + 16;
Color := <DayTasks."BackgroundColor">;
end;
end;
begin
end." PropData="044C65667403940003546F70027408446174617365747301010C1500000020446174615365744E616D653D224D6F6E7468732200010C1300000020446174615365744E616D653D22446179732200010C1700000020446174615365744E616D653D224461795461736B73220000095661726961626C65730100055374796C650100">