FastReport_FMX_2.8.12/Demos/Main/71.fr3

45 lines
9.0 KiB
Plaintext
Raw Permalink Normal View History

2024-01-10 21:50:38 +01:00
<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.9" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="38264,8615800926" ReportOptions.Description.Text="Demonstrates how to print simple year calendar using old-style cross tab and script." ReportOptions.LastChange="40273,6832695602" ScriptLanguage="PascalScript" ScriptText.Text="var&#13;&#10; Months: array[1..12] of string;&#13;&#10; Days: array[1..7] of string;&#13;&#10; Year, Month, TheMonth: Integer;&#13;&#10; DayLine, StartDay, LastDay: Integer;&#13;&#10; Day: String;&#13;&#10;&#13;&#10;function StartOfMonth(Year, Month: Integer): Integer;&#13;&#10;begin&#13;&#10; Result := DayOfWeek(EncodeDate(Year, Month, 1));&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; TheMonth := (&#60;Line&#62; - 1) * 3;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Header1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; Month := TheMonth + 1;&#13;&#10; DayLine := 0;&#13;&#10; StartDay := StartOfMonth(Year, Month);&#13;&#10; LastDay := DaysInMonth(Year, Month);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Header2OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; Month := TheMonth + 2;&#13;&#10; DayLine := 0;&#13;&#10; StartDay := StartOfMonth(Year, Month);&#13;&#10; LastDay := DaysInMonth(Year, Month);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Header3OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; Month := TheMonth + 3;&#13;&#10; DayLine := 0;&#13;&#10; StartDay := StartOfMonth(Year, Month);&#13;&#10; LastDay := DaysInMonth(Year, Month);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData3OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; Inc(DayLine);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;var&#13;&#10; CellNo: Integer;&#13;&#10;begin&#13;&#10; CellNo := DayLine + (&#60;Line&#62; - 1) * 7;&#13;&#10; if (CellNo &#60; StartDay) or&#13;&#10; (CellNo - StartDay + 1 &#62; LastDay) then&#13;&#10; Day := '' else&#13;&#10; Day := IntToStr(CellNo - StartDay + 1);&#13;&#10;&#13;&#10; if Day = '' then&#13;&#10; TfrxMemoView(Sender).Frame.Typ := 0&#13;&#10; else&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10; Year := YearOf(Now); &#13;&#10;&#13;&#10; Months[1] := 'January';&#13;&#10; Months[2] := 'February';&#13;&#10; Months[3] := 'March';&#13;&#10; Months[4] := 'April';&#13;&#10; Months[5] := 'May';&#13;&#10; Months[6] := 'June';&#13;&#10; Months[7] := 'July';&#13;&#10; Months[8] := 'August';&#13;&#10; Months[9] := 'September';&#13;&#10; Months[10] := 'October';&#13;&#10; Months[11] := 'November';&#13;&#10; Months[12] := 'December';&#13;&#10;&#13;&#10; Days[1] := 'Su';&#13;&#10; Days[2] := 'Mo';&#13;&#10; Days[3] := 'Tu';&#13;&#10; Days[4] := 'We';&#13;&#10; Days[5] := 'Th';&#13;&#10; Days[6] := 'Fr';&#13;&#10; Days[7] := 'Sa';&#13;&#10;end." PropData="044C656674025803546F700370010844617461736574730100095661726961626C65730100055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData1" Height="22,67718" Left="0" Top="113,3859" Width="718,1107" OnBeforePrint="MasterData1OnBeforePrint" Child="Child1" ColumnWidth="0" ColumnGap="0" RowCount="4" Stretched="True">
<TfrxSubreport Name="Subreport1" Left="0" Top="0" Width="94,48825" Height="18,89765" ShowHint="False" Page="Page2"/>
<TfrxSubreport Name="Subreport2" Left="188,9765" Top="0" Width="94,48825" Height="18,89765" ShowHint="False" Page="Page3"/>
<TfrxSubreport Name="Subreport3" Left="351,49629" Top="0" Width="94,48825" Height="18,89765" ShowHint="False" Page="Page4"/>
</TfrxMasterData>
<TfrxChild Name="Child1" Height="34,01577" Left="0" Top="158,74026" Width="718,1107"/>
<TfrxReportTitle Name="ReportTitle1" Height="34,01577" Left="0" Top="18,89765" Width="718,1107">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="718,1107" Height="22,67718" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" Text="Calendar - [Year]"/>
</TfrxReportTitle>
</TfrxReportPage>
<TfrxReportPage Name="Page2" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData3" Height="22,67718" Left="0" Top="60,47248" Width="718,1107" OnBeforePrint="MasterData3OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7">
<TfrxMemoView Name="Memo1" Left="260,78757" Top="0" Width="22,67718" Height="22,67718" OnBeforePrint="Memo1OnBeforePrint" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Day]"/>
<TfrxMemoView Name="Memo7" Left="211,65368" Top="0" Width="22,67718" Height="22,67718" ShowHint="False" Color="14211288" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Days[DayLine]]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData4" Height="1046,92981" Left="260,78757" Top="0" Vertical="True" Width="22,67718" ColumnWidth="0" ColumnGap="0" RowCount="6"/>
<TfrxHeader Name="Header1" Height="18,89765" Left="0" Top="18,89765" Width="718,1107" OnBeforePrint="Header1OnBeforePrint">
<TfrxMemoView Name="Memo4" Left="22,67718" Top="0" Width="136,06308" Height="18,89765" ShowHint="False" Color="14211288" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Months[Month]]"/>
</TfrxHeader>
<TfrxHeader Name="Header4" Height="1046,92981" Left="211,65368" Top="0" Vertical="True" Width="22,67718"/>
</TfrxReportPage>
<TfrxReportPage Name="Page3" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData2" Height="22,67718" Left="0" Top="60,47248" Width="718,1107" OnBeforePrint="MasterData3OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7">
<TfrxMemoView Name="Memo2" Left="200,31509" Top="0" Width="22,67718" Height="22,67718" OnBeforePrint="Memo1OnBeforePrint" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Day]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData5" Height="1046,92981" Left="200,31509" Top="0" Vertical="True" Width="22,67718" ColumnWidth="0" ColumnGap="0" RowCount="6"/>
<TfrxHeader Name="Header2" Height="18,89765" Left="0" Top="18,89765" Width="718,1107" OnBeforePrint="Header2OnBeforePrint">
<TfrxMemoView Name="Memo5" Left="0" Top="0" Width="136,06308" Height="18,89765" ShowHint="False" Color="14211288" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Months[Month]]"/>
</TfrxHeader>
</TfrxReportPage>
<TfrxReportPage Name="Page4" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData6" Height="22,67718" Left="0" Top="60,47248" Width="718,1107" OnBeforePrint="MasterData3OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7">
<TfrxMemoView Name="Memo3" Left="211,65368" Top="0" Width="22,67718" Height="22,67718" OnBeforePrint="Memo1OnBeforePrint" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Day]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData7" Height="1046,92981" Left="211,65368" Top="0" Vertical="True" Width="22,67718" ColumnWidth="0" ColumnGap="0" RowCount="6"/>
<TfrxHeader Name="Header3" Height="18,89765" Left="0" Top="18,89765" Width="718,1107" OnBeforePrint="Header3OnBeforePrint">
<TfrxMemoView Name="Memo6" Left="0" Top="0" Width="136,06308" Height="18,89765" ShowHint="False" Color="14211288" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Months[Month]]"/>
</TfrxHeader>
</TfrxReportPage>
</TfrxReport>