58 lines
15 KiB
XML
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 Months: array[1..12] of string; Days: array[1..7] of string; Year, Month, TheMonth: Integer; StartDay, LastDay, colnum: Integer; Day: String; function StartOfMonth(Year, Month: Integer): Integer; begin Result := DayOfWeek(EncodeDate(Year, Month, 1)); end; function mycolor(cn:Integer):TAlphaColor; begin case cn of 1: result := clasilver; 7..8: result := clasilver; 14..15: result := clasilver; 21..22: result := clasilver; 28..29: result := clasilver; 35..36: result := clasilver; else result := clawhite; end; end; procedure MasterData1OnBeforePrint(Sender: TfrxComponent); begin TheMonth := (<Line> - 1) * 3; end; procedure Header1OnBeforePrint(Sender: TfrxComponent); begin Month := TheMonth + 1; colnum:= 0; end; procedure MasterData4OnBeforePrint(Sender: TfrxComponent); begin inc(colnum); end; procedure Memo3OnBeforePrint(Sender: TfrxComponent); begin if (Colnum < StartDay) or (Colnum - StartDay + 1 > LastDay) then Day := '' else Day := IntToStr(colnum-startday+1); if Day = '' then begin if colnum > 7 then TfrxMemoView(Sender).Frame.Typ := 0 else TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; //TfrxMemoView(Sender).color := 0; end else begin TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; // TfrxMemoView(Sender).color := mycolor(colnum); end; end; procedure Memo1OnAfterPrint(Sender: TfrxComponent); begin if colnum = 7 then colnum := 0; end; procedure MasterData3OnBeforePrint(Sender: TfrxComponent); begin StartDay := StartOfMonth(Year, Month); LastDay := DaysInMonth(Year, Month); end; procedure Header2OnBeforePrint(Sender: TfrxComponent); begin Month := TheMonth + 2; colnum:= 0; end; procedure MasterData5OnBeforePrint(Sender: TfrxComponent); begin inc(colnum); end; procedure Memo6OnAfterPrint(Sender: TfrxComponent); begin if colnum = 7 then colnum := 0; end; procedure Memo4OnBeforePrint(Sender: TfrxComponent); begin if (Colnum < StartDay) or (Colnum - StartDay + 1 > LastDay) then Day := '' else Day := IntToStr(colnum-startday+1); if Day = '' then begin if colnum > 7 then TfrxMemoView(Sender).Frame.Typ := 0 else TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; //TfrxMemoView(Sender).color := 0; end else begin TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; // TfrxMemoView(Sender).color := mycolor(colnum); end; end; procedure MasterData2OnBeforePrint(Sender: TfrxComponent); begin StartDay := StartOfMonth(Year, Month); LastDay := DaysInMonth(Year, Month); end; procedure Header3OnBeforePrint(Sender: TfrxComponent); begin Month := TheMonth + 3; colnum:= 0; end; procedure Memo10OnAfterPrint(Sender: TfrxComponent); begin if colnum = 7 then colnum := 0; end; procedure MasterData7OnBeforePrint(Sender: TfrxComponent); begin inc(colnum); end; procedure Memo7OnBeforePrint(Sender: TfrxComponent); begin if (Colnum < StartDay) or (Colnum - StartDay + 1 > LastDay) then Day := '' else Day := IntToStr(colnum-startday+1); if Day = '' then begin if colnum > 7 then TfrxMemoView(Sender).Frame.Typ := 0 else TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; //TfrxMemoView(Sender).color := 0; end else begin TfrxMemoView(Sender).Frame.Typ := ftLeft + ftRight + ftTop + ftBottom; // TfrxMemoView(Sender).color := mycolor(colnum); end; end; procedure MasterData6OnBeforePrint(Sender: TfrxComponent); begin StartDay := StartOfMonth(Year, Month); LastDay := DaysInMonth(Year, Month); end; procedure DialogPage1OnActivate(Sender: TfrxComponent); var i:integer; begin i := 2000; for i:= 2000 to 2050 do begin with combobox1 do items.add(inttostr(i)); end; dialogpage1.caption := 'US Style Calendar'; combobox1.itemindex := 0; end; procedure Button1OnClick(Sender: TfrxComponent); begin Year:= strtoint(ComboBox1.Items[ComboBox1.ItemIndex]); end; begin Months[1] := 'January'; Months[2] := 'February'; Months[3] := 'March'; Months[4] := 'April'; Months[5] := 'May'; Months[6] := 'June'; Months[7] := 'July'; Months[8] := 'August'; Months[9] := 'September'; Months[10] := 'October'; Months[11] := 'November'; Months[12] := 'December'; Days[1] := 'Sun'; Days[2] := 'Mon'; Days[3] := 'Tue'; Days[4] := 'Wed'; Days[5] := 'Thu'; Days[6] := 'Fri'; Days[7] := 'Sat'; 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>
|