FastReport_FMX_2.8.12/Demos/Main/72.fr3
2024-07-06 22:41:12 +02:00

58 lines
15 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.11.4" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Author="gk" ReportOptions.CreateDate="38264,8615800926" ReportOptions.Description.Text="Demonstrates how to print simple year calendar using old-style cross tab and script. Layout is in North American Style." ReportOptions.Name="Calendar2" ReportOptions.LastChange="41019,6851568403" ReportOptions.VersionMajor="1" ReportOptions.VersionMinor="0" 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; StartDay, LastDay, colnum: 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;function mycolor(cn:Integer):TAlphaColor;&#13;&#10;begin&#13;&#10;case cn of&#13;&#10;1: result := clasilver;&#13;&#10;7..8: result := clasilver;&#13;&#10;14..15: result := clasilver;&#13;&#10;21..22: result := clasilver;&#13;&#10;28..29: result := clasilver;&#13;&#10;35..36: result := clasilver;&#13;&#10;else result := clawhite;&#13;&#10;end;&#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; colnum:= 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData4OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; inc(colnum);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo3OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if (Colnum &#60; StartDay) or&#13;&#10; (Colnum - StartDay + 1 &#62; LastDay) then&#13;&#10; Day := '' else&#13;&#10; Day := IntToStr(colnum-startday+1);&#13;&#10;&#13;&#10; if Day = '' then&#13;&#10; begin&#13;&#10; if colnum &#62; 7 then TfrxMemoView(Sender).Frame.Typ := 0 else&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; //TfrxMemoView(Sender).color := 0;&#13;&#10; end&#13;&#10; else&#13;&#10; begin&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; // TfrxMemoView(Sender).color := mycolor(colnum);&#13;&#10; end;&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;procedure Memo1OnAfterPrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if colnum = 7 then colnum := 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData3OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#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; colnum:= 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData5OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; inc(colnum);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo6OnAfterPrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;if colnum = 7 then colnum := 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo4OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if (Colnum &#60; StartDay) or&#13;&#10; (Colnum - StartDay + 1 &#62; LastDay) then&#13;&#10; Day := '' else&#13;&#10; Day := IntToStr(colnum-startday+1);&#13;&#10;&#13;&#10; if Day = '' then&#13;&#10; begin&#13;&#10; if colnum &#62; 7 then TfrxMemoView(Sender).Frame.Typ := 0 else&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; //TfrxMemoView(Sender).color := 0;&#13;&#10; end&#13;&#10; else&#13;&#10; begin&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; // TfrxMemoView(Sender).color := mycolor(colnum);&#13;&#10; end;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData2OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#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; colnum:= 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo10OnAfterPrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if colnum = 7 then colnum := 0;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData7OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; inc(colnum);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure Memo7OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if (Colnum &#60; StartDay) or&#13;&#10; (Colnum - StartDay + 1 &#62; LastDay) then&#13;&#10; Day := '' else&#13;&#10; Day := IntToStr(colnum-startday+1);&#13;&#10;&#13;&#10; if Day = '' then&#13;&#10; begin&#13;&#10; if colnum &#62; 7 then TfrxMemoView(Sender).Frame.Typ := 0 else&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; //TfrxMemoView(Sender).color := 0;&#13;&#10; end&#13;&#10; else&#13;&#10; begin&#13;&#10; TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;&#13;&#10; // TfrxMemoView(Sender).color := mycolor(colnum);&#13;&#10; end;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure MasterData6OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; StartDay := StartOfMonth(Year, Month);&#13;&#10; LastDay := DaysInMonth(Year, Month);&#13;&#10;end;&#13;&#10;&#13;&#10;procedure DialogPage1OnActivate(Sender: TfrxComponent);&#13;&#10;var&#13;&#10;i:integer;&#13;&#10;begin&#13;&#10;i := 2000;&#13;&#10;for i:= 2000 to 2050 do&#13;&#10; begin&#13;&#10; with combobox1 do&#13;&#10; items.add(inttostr(i));&#13;&#10; end;&#13;&#10; dialogpage1.caption := 'US Style Calendar';&#13;&#10; combobox1.itemindex := 0;&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;procedure Button1OnClick(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; Year:= strtoint(ComboBox1.Items[ComboBox1.ItemIndex]);&#13;&#10;end;&#13;&#10;&#13;&#10;begin&#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] := 'Sun';&#13;&#10; Days[2] := 'Mon';&#13;&#10; Days[3] := 'Tue';&#13;&#10; Days[4] := 'Wed';&#13;&#10; Days[5] := 'Thu';&#13;&#10; Days[6] := 'Fri';&#13;&#10; Days[7] := 'Sat';&#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="20,89765" Left="0" Top="105,82684" 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="241,88992" Top="0" Width="94,48825" Height="18,89765" ShowHint="False" Page="Page3"/>
<TfrxSubreport Name="Subreport3" Left="480,00031" Top="0" Width="94,48825" Height="18,89765" ShowHint="False" Page="Page4"/>
</TfrxMasterData>
<TfrxChild Name="Child1" Height="7,01577" Left="0" Top="147,40167" Width="718,1107"/>
<TfrxReportTitle Name="ReportTitle1" Height="30,23624" Left="0" Top="18,89765" Width="718,1107">
<TfrxMemoView Name="Memo8" Left="283,46475" Top="0" Width="151,1812" Height="18,89765" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-13" 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="18,89765" Left="0" Top="90,70872" Width="718,1107" OnBeforePrint="MasterData3OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="6">
<TfrxMemoView Name="Memo3" Left="249,44898" Top="0" Width="30,23624" Height="18,89765" OnBeforePrint="Memo3OnBeforePrint" ShowHint="False" Color="65535" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[day]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData4" Height="1046,92981" Left="249,44898" Top="0" Vertical="True" Width="30,23624" OnBeforePrint="MasterData4OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7"/>
<TfrxHeader Name="Header1" Height="18,89765" Left="0" Top="18,89765" Width="718,1107" OnBeforePrint="Header1OnBeforePrint" Child="Child2">
<TfrxMemoView Name="Memo2" Left="0" Top="0" Width="211,65368" Height="18,89765" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[Months[Month]]"/>
</TfrxHeader>
<TfrxChild Name="Child2" Height="15,11812" Left="0" Top="56,69295" Width="718,1107">
<TfrxMemoView Name="Memo1" Left="249,44898" Top="0" Width="30,23624" Height="15,11812" OnAfterPrint="Memo1OnAfterPrint" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[days[colnum]]"/>
</TfrxChild>
</TfrxReportPage>
<TfrxReportPage Name="Page3" PaperWidth="215,9" PaperHeight="279,4" PaperSize="1" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData2" Height="18,89765" Left="0" Top="92" Width="740,409927" OnBeforePrint="MasterData2OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="6">
<TfrxMemoView Name="Memo4" Left="18,89765" Top="0" Width="30,23624" Height="18,89765" OnBeforePrint="Memo4OnBeforePrint" ShowHint="False" Color="65535" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[day]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData5" Height="980,410082" Left="18,89765" Top="0" Vertical="True" Width="30,23624" OnBeforePrint="MasterData5OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7"/>
<TfrxHeader Name="Header2" Height="18,89765" Left="0" Top="16" Width="740,409927" OnBeforePrint="Header2OnBeforePrint" Child="Child3">
<TfrxMemoView Name="Memo5" Left="0" Top="0" Width="211,65368" Height="18,89765" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[Months[Month]]"/>
</TfrxHeader>
<TfrxChild Name="Child3" Height="15,11812" Left="0" Top="56" Width="740,409927">
<TfrxMemoView Name="Memo6" Left="18,89765" Top="0" Width="30,23624" Height="15,11812" OnAfterPrint="Memo6OnAfterPrint" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[days[colnum]]"/>
</TfrxChild>
</TfrxReportPage>
<TfrxReportPage Name="Page4" PaperWidth="215,9" PaperHeight="279,4" PaperSize="1" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxMasterData Name="MasterData6" Height="18,89765" Left="0" Top="92" Width="740,409927" OnBeforePrint="MasterData6OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="6">
<TfrxMemoView Name="Memo7" Left="238,11039" Top="0" Width="30,23624" Height="18,89765" OnBeforePrint="Memo7OnBeforePrint" ShowHint="False" Color="65535" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[day]"/>
</TfrxMasterData>
<TfrxMasterData Name="MasterData7" Height="980,410082" Left="238,11039" Top="0" Vertical="True" Width="30,23624" OnBeforePrint="MasterData7OnBeforePrint" ColumnWidth="0" ColumnGap="0" RowCount="7"/>
<TfrxHeader Name="Header3" Height="18,89765" Left="0" Top="16" Width="740,409927" OnBeforePrint="Header3OnBeforePrint" Child="Child3">
<TfrxMemoView Name="Memo9" Left="0" Top="0" Width="211,65368" Height="18,89765" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[Months[Month]]"/>
</TfrxHeader>
<TfrxChild Name="Child4" Height="15,11812" Left="0" Top="56" Width="740,409927">
<TfrxMemoView Name="Memo10" Left="238,11039" Top="0" Width="30,23624" Height="15,11812" OnAfterPrint="Memo10OnAfterPrint" ShowHint="False" Color="-16777201" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[days[colnum]]"/>
</TfrxChild>
</TfrxReportPage>
<TfrxDialogPage Name="DialogPage1" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="0" Caption="Show" Height="200" ClientHeight="162" Left="264" Top="236" Width="300" ClientWidth="284" OnActivate="DialogPage1OnActivate">
<TfrxComboBoxControl Name="ComboBox1" Left="114" Top="27" Width="76" Height="21" ShowHint="True" Color="-16777211" Items.Text="" ItemIndex="-1"/>
<TfrxButtonControl Name="Button1" Left="53" Top="99" Width="75" Height="25" ShowHint="True" Caption="Show" ModalResult="1" OnClick="Button1OnClick"/>
<TfrxLabelControl Name="Label1" Left="110" Top="3" Width="73" Height="13" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" ParentFont="False" ShowHint="True" Caption="select a year" Color="-16777201"/>
<TfrxButtonControl Name="Button2" Left="184" Top="102" Width="75" Height="25" ShowHint="True" Cancel="True" Caption="Cancel" Default="True" ModalResult="2"/>
</TfrxDialogPage>
</TfrxReport>