tvplanit: Add simple printing test projects

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8545 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-10-12 20:24:11 +00:00
parent 3cb293895d
commit 6242422cf8
34 changed files with 3166 additions and 0 deletions

View File

@ -0,0 +1,99 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Tasks of resource 1178568021]
1={Complete:false}|{Description:Test 1}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/09/22}
2={Complete:false}|{Description:Test 2}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/01}
3={Complete:false}|{Description:Test 3}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/02}
4={Complete:false}|{Description:Test 4}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/03}
5={Complete:false}|{Description:Test 5}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/04}
6={Complete:false}|{Description:Test 6}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/05}
7={Complete:false}|{Description:Test 7}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/06}
8={Complete:false}|{Description:Test 8}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/07}
9={Complete:false}|{Description:Test 9}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/08}
10={Complete:false}|{Description:Test 10}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/09}
11={Complete:false}|{Description:Test 11}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/10}
12={Complete:false}|{Description:Test 12}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/11}
13={Complete:false}|{Description:Test 13}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/12}
14={Complete:false}|{Description:Test 14}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/13}
15={Complete:false}|{Description:Test 15}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/14}
16={Complete:false}|{Description:Test 16}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/15}
17={Complete:false}|{Description:Test 17}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/16}
18={Complete:false}|{Description:Test 18}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/17}
19={Complete:false}|{Description:Test 19}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/18}
20={Complete:false}|{Description:Test 20}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/19}
21={Complete:false}|{Description:Test 21}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/20}
22={Complete:false}|{Description:Test 22}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/21}
23={Complete:false}|{Description:Test 23}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/22}
24={Complete:false}|{Description:Test 24}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/23}
25={Complete:false}|{Description:Test 25}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/24}
26={Complete:false}|{Description:Test 26}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/25}
27={Complete:false}|{Description:Test 27}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/26}
28={Complete:false}|{Description:Test 28}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/27}
29={Complete:false}|{Description:Test 29}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/28}
30={Complete:false}|{Description:Test 30}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/29}
31={Complete:false}|{Description:Test 31}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/30}
32={Complete:false}|{Description:Test 32}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/01}
33={Complete:false}|{Description:Test 33}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/02}
34={Complete:false}|{Description:Test 34}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/03}
35={Complete:false}|{Description:Test 35}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/04}
36={Complete:false}|{Description:Test 36}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/05}
37={Complete:false}|{Description:Test 37}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/06}
38={Complete:false}|{Description:Test 38}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/07}
39={Complete:false}|{Description:Test 39}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/08}
40={Complete:false}|{Description:Test 40}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/09}
41={Complete:false}|{Description:Test 41}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/10}
42={Complete:false}|{Description:Test 42}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/11}
43={Complete:false}|{Description:Test 43}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/12}
44={Complete:false}|{Description:Test 44}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/13}
45={Complete:false}|{Description:Test 45}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/14}
46={Complete:false}|{Description:Test 46}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/15}
47={Complete:false}|{Description:Test 47}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/16}
48={Complete:false}|{Description:Test 48}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/17}
49={Complete:false}|{Description:Test 49}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/18}
50={Complete:false}|{Description:Test 50}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/19}
51={Complete:false}|{Description:Test 51}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/20}
52={Complete:false}|{Description:Test 52}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/21}
53={Complete:false}|{Description:Test 53}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/22}
54={Complete:false}|{Description:Test 54}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/23}
55={Complete:false}|{Description:Test 55}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/24}
56={Complete:false}|{Description:Test 56}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/25}
57={Complete:false}|{Description:Test 57}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/26}
58={Complete:false}|{Description:Test 58}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/27}
59={Complete:false}|{Description:Test 59}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/28}
60={Complete:false}|{Description:Test 60}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/29}
61={Complete:false}|{Description:Test 61}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/30}
62={Complete:false}|{Description:Test 62}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/01}
63={Complete:false}|{Description:Test 63}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/02}
64={Complete:false}|{Description:Test 64}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/03}
65={Complete:false}|{Description:Test 65}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/04}
66={Complete:false}|{Description:Test 66}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/05}
67={Complete:false}|{Description:Test 67}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/06}
68={Complete:false}|{Description:Test 68}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/07}
69={Complete:false}|{Description:Test 69}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/08}
70={Complete:false}|{Description:Test 70}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/09}
71={Complete:false}|{Description:Test 71}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/10}
72={Complete:false}|{Description:Test 72}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/11}
73={Complete:false}|{Description:Test 73}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/12}
74={Complete:false}|{Description:Test 74}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/13}
75={Complete:false}|{Description:Test 75}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/14}
76={Complete:false}|{Description:Test 76}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/15}
77={Complete:false}|{Description:Test 77}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/16}
78={Complete:false}|{Description:Test 78}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/17}
79={Complete:false}|{Description:Test 79}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/18}
80={Complete:false}|{Description:Test 80}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/19}
81={Complete:false}|{Description:Test 81}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/20}
82={Complete:false}|{Description:Test 82}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/21}
83={Complete:false}|{Description:Test 83}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/22}
84={Complete:false}|{Description:Test 84}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/23}
85={Complete:false}|{Description:Test 85}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/24}
86={Complete:false}|{Description:Test 86}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/25}
87={Complete:false}|{Description:Test 87}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/26}
88={Complete:false}|{Description:Test 88}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/27}
89={Complete:false}|{Description:Test 89}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/28}
90={Complete:false}|{Description:Test 90}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/29}
91={Complete:false}|{Description:Test 91}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/30}
92={Complete:false}|{Description:Test 92}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/31}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="tlPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="tlPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="tlmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="tlMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="tlPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program tlPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, tlMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,221 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 636
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 636
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 624
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 624
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpTaskList1: TVpTaskList
Left = 0
Height = 485
Top = 38
Width = 636
PopupMenu = VpTaskList1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
Align = alClient
TabOrder = 1
DisplayOptions.NormalColor = clBlack
LineColor = clGray
TaskHeadAttributes.Color = clSilver
TaskHeadAttributes.Font.Height = -12
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Portrait'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Landscape 270°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Portrait Upside-down'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 328
Top = 88
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,87 @@
unit tlMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox,
VpContactGrid, VpContactButtons, VpTaskList;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
VpTaskList1: TVpTaskList;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers, OSPrinters;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
end;
end.