You've already forked lazarus-ccr
PowerPDF Check In
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@585 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
13
components/powerpdf/Example/DBExample/DBExample.dpr
Normal file
13
components/powerpdf/Example/DBExample/DBExample.dpr
Normal file
@@ -0,0 +1,13 @@
|
||||
program DBExample;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
UDBExample in 'UDBExample.pas' {Form1};
|
||||
|
||||
{$R *.RES}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
285
components/powerpdf/Example/DBExample/DBExample.dsk
Normal file
285
components/powerpdf/Example/DBExample/DBExample.dsk
Normal file
@@ -0,0 +1,285 @@
|
||||
[Closed Files]
|
||||
File_0=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PRJpegImage.pas',0,1,1,1,1,0,0
|
||||
File_1=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfDoc.pas',0,1,1,1,1,0,0
|
||||
File_2=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfFonts.pas',0,1,1,1,1,0,0
|
||||
File_3=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfGBFonts.pas',0,1,1,1,1,0,0
|
||||
File_4=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfImages.pas',0,1,1,1,1,0,0
|
||||
File_5=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfJpCMap.pas',0,1,1,1,1,0,0
|
||||
File_6=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfJpegImage.pas',0,1,1,1,1,0,0
|
||||
File_7=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfJPFonts.pas',0,1,1,1,1,0,0
|
||||
File_8=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PdfTypes.pas',0,1,1,1,1,0,0
|
||||
File_9=SourceModule,'D:\Werk\GlueIQ\Components\PowerPdf\PowerPdf.pas',0,1,1,1,1,0,0
|
||||
|
||||
[Modules]
|
||||
Module0=D:\Werk\GlueIQ\Components\PowerPdf\Example\DBExample\UDBExample.pas
|
||||
Module1=D:\Werk\GlueIQ\Components\PowerPdf\PReport.pas
|
||||
Count=2
|
||||
EditWindowCount=1
|
||||
|
||||
[D:\Werk\GlueIQ\Components\PowerPdf\Example\DBExample\UDBExample.pas]
|
||||
ModuleType=SourceModule
|
||||
FormState=1
|
||||
FormOnTop=0
|
||||
|
||||
[D:\Werk\GlueIQ\Components\PowerPdf\PReport.pas]
|
||||
ModuleType=SourceModule
|
||||
FormState=0
|
||||
FormOnTop=0
|
||||
|
||||
[C:\Program Files\Borland\Delphi6\Projects\ProjectGroup1.bpg]
|
||||
FormState=0
|
||||
FormOnTop=0
|
||||
|
||||
[D:\Werk\GlueIQ\Components\PowerPdf\Example\DBExample\DBExample.dpr]
|
||||
FormState=0
|
||||
FormOnTop=0
|
||||
|
||||
[EditWindow0]
|
||||
ViewCount=2
|
||||
CurrentView=0
|
||||
View0=0
|
||||
View1=1
|
||||
CodeExplorer=CodeExplorer@EditWindow0
|
||||
MessageView=MessageView@EditWindow0
|
||||
Create=1
|
||||
Visible=1
|
||||
State=0
|
||||
Left=271
|
||||
Top=136
|
||||
Width=870
|
||||
Height=502
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=862
|
||||
ClientHeight=468
|
||||
LeftPanelSize=140
|
||||
LeftPanelClients=CodeExplorer@EditWindow0
|
||||
LeftPanelData=000004000000000000000000000000000000000000000000000100000000000000000C000000436F64654578706C6F726572FFFFFFFF
|
||||
RightPanelSize=0
|
||||
BottomPanelSize=0
|
||||
BottomPanelClients=MessageView@EditWindow0
|
||||
BottomPanelData=00000400010000000B0000004D657373616765566965770000000000000000000000000000000000FFFFFFFF
|
||||
|
||||
[View0]
|
||||
Module=D:\Werk\GlueIQ\Components\PowerPdf\Example\DBExample\UDBExample.pas
|
||||
CursorX=1
|
||||
CursorY=128
|
||||
TopLine=126
|
||||
LeftCol=1
|
||||
|
||||
[View1]
|
||||
Module=D:\Werk\GlueIQ\Components\PowerPdf\PReport.pas
|
||||
CursorX=33
|
||||
CursorY=1091
|
||||
TopLine=1083
|
||||
LeftCol=1
|
||||
|
||||
[Watches]
|
||||
Count=0
|
||||
|
||||
[Breakpoints]
|
||||
Count=0
|
||||
|
||||
[AddressBreakpoints]
|
||||
Count=0
|
||||
|
||||
[Main Window]
|
||||
Create=1
|
||||
Visible=1
|
||||
State=2
|
||||
Left=313
|
||||
Top=74
|
||||
Width=967
|
||||
Height=112
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
MaxWidth=1288
|
||||
MaxHeight=112
|
||||
ClientWidth=1280
|
||||
ClientHeight=78
|
||||
|
||||
[ProjectManager]
|
||||
Create=1
|
||||
Visible=1
|
||||
State=0
|
||||
Left=941
|
||||
Top=106
|
||||
Width=339
|
||||
Height=591
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=331
|
||||
ClientHeight=565
|
||||
TBDockHeight=303
|
||||
LRDockWidth=471
|
||||
Dockable=1
|
||||
|
||||
[CPUWindow]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=436
|
||||
Top=133
|
||||
Width=531
|
||||
Height=351
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=523
|
||||
ClientHeight=317
|
||||
DumpPane=79
|
||||
DisassemblyPane=187
|
||||
RegisterPane=231
|
||||
FlagPane=64
|
||||
|
||||
[AlignmentPalette]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=200
|
||||
Top=107
|
||||
Width=156
|
||||
Height=84
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=150
|
||||
ClientHeight=60
|
||||
|
||||
[PropertyInspector]
|
||||
Create=1
|
||||
Visible=1
|
||||
State=0
|
||||
Left=0
|
||||
Top=150
|
||||
Width=261
|
||||
Height=575
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=253
|
||||
ClientHeight=549
|
||||
TBDockHeight=521
|
||||
LRDockWidth=190
|
||||
Dockable=1
|
||||
SplitPos=110
|
||||
ArrangeBy=Name
|
||||
SelectedItem=Name
|
||||
ExpandedItems=Options
|
||||
HiddenCategories=
|
||||
|
||||
[WatchWindow]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=11
|
||||
Top=133
|
||||
Width=339
|
||||
Height=536
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=331
|
||||
ClientHeight=510
|
||||
TBDockHeight=594
|
||||
LRDockWidth=471
|
||||
Dockable=1
|
||||
|
||||
[CallStackWindow]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=0
|
||||
Top=0
|
||||
Width=431
|
||||
Height=784
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=423
|
||||
ClientHeight=758
|
||||
TBDockHeight=161
|
||||
LRDockWidth=294
|
||||
Dockable=1
|
||||
|
||||
[ThreadStatusWindow]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=488
|
||||
Top=524
|
||||
Width=624
|
||||
Height=152
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=616
|
||||
ClientHeight=126
|
||||
TBDockHeight=152
|
||||
LRDockWidth=624
|
||||
Dockable=1
|
||||
Column0Width=145
|
||||
Column1Width=100
|
||||
Column2Width=115
|
||||
Column3Width=250
|
||||
|
||||
[ObjectTree]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=0
|
||||
Top=178
|
||||
Width=98
|
||||
Height=547
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=90
|
||||
ClientHeight=521
|
||||
TBDockHeight=354
|
||||
LRDockWidth=190
|
||||
Dockable=1
|
||||
|
||||
[FPUWindow]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=271
|
||||
Top=248
|
||||
Width=457
|
||||
Height=250
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=449
|
||||
ClientHeight=216
|
||||
RegisterPane=121
|
||||
FlagPane=59
|
||||
|
||||
[CodeExplorer@EditWindow0]
|
||||
Create=1
|
||||
Visible=1
|
||||
State=0
|
||||
Left=0
|
||||
Top=12
|
||||
Width=140
|
||||
Height=456
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=140
|
||||
ClientHeight=456
|
||||
TBDockHeight=305
|
||||
LRDockWidth=140
|
||||
Dockable=1
|
||||
|
||||
[MessageView@EditWindow0]
|
||||
Create=1
|
||||
Visible=0
|
||||
State=0
|
||||
Left=-77
|
||||
Top=-527
|
||||
Width=443
|
||||
Height=52
|
||||
MaxLeft=-1
|
||||
MaxTop=-1
|
||||
ClientWidth=443
|
||||
ClientHeight=52
|
||||
TBDockHeight=52
|
||||
LRDockWidth=443
|
||||
Dockable=1
|
||||
|
||||
[DockHosts]
|
||||
DockHostCount=0
|
||||
|
||||
BIN
components/powerpdf/Example/DBExample/DBExample.res
Normal file
BIN
components/powerpdf/Example/DBExample/DBExample.res
Normal file
Binary file not shown.
BIN
components/powerpdf/Example/DBExample/UDBExample.dfm
Normal file
BIN
components/powerpdf/Example/DBExample/UDBExample.dfm
Normal file
Binary file not shown.
136
components/powerpdf/Example/DBExample/UDBExample.pas
Normal file
136
components/powerpdf/Example/DBExample/UDBExample.pas
Normal file
@@ -0,0 +1,136 @@
|
||||
unit UDBExample;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||
PReport, ExtCtrls, PdfDoc, Menus, ComCtrls, Db, DBTables, PdfTypes;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
StatusBar1: TStatusBar;
|
||||
ScrollBox1: TScrollBox;
|
||||
MainMenu1: TMainMenu;
|
||||
File1: TMenuItem;
|
||||
CreatePDF1: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
Exit1: TMenuItem;
|
||||
Help1: TMenuItem;
|
||||
About1: TMenuItem;
|
||||
PReport1: TPReport;
|
||||
SaveDialog1: TSaveDialog;
|
||||
PRPage1: TPRPage;
|
||||
PRLayoutPanel1: TPRLayoutPanel;
|
||||
PRGridPanel1: TPRGridPanel;
|
||||
PRText1: TPRText;
|
||||
Table1: TTable;
|
||||
PRLayoutPanel2: TPRLayoutPanel;
|
||||
PRText2: TPRText;
|
||||
PRRect1: TPRRect;
|
||||
PRText3: TPRText;
|
||||
PRText4: TPRText;
|
||||
PRText5: TPRText;
|
||||
PRText6: TPRText;
|
||||
TxtCustNo: TPRText;
|
||||
TxtCompany: TPRText;
|
||||
TxtAddr: TPRText;
|
||||
TxtCity: TPRText;
|
||||
TxtState: TPRText;
|
||||
PRRect2: TPRRect;
|
||||
Table1CustNo: TFloatField;
|
||||
Table1Company: TStringField;
|
||||
Table1Addr1: TStringField;
|
||||
Table1City: TStringField;
|
||||
Table1State: TStringField;
|
||||
procedure CreatePDF1Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure PRGridPanel1BeforePrintChild(Sender: TObject;
|
||||
ACanvas: TPRCanvas; ACol, ARow: Integer; Rect: TRect);
|
||||
procedure About1Click(Sender: TObject);
|
||||
procedure Exit1Click(Sender: TObject);
|
||||
private
|
||||
public
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
procedure TForm1.CreatePDF1Click(Sender: TObject);
|
||||
begin
|
||||
if SaveDialog1.Execute then
|
||||
begin
|
||||
Screen.Cursor := crHourGlass;
|
||||
Application.ProcessMessages;
|
||||
TxtCustNo.Printable := true;
|
||||
TxtCompany.Printable := true;
|
||||
TxtAddr.Printable := true;
|
||||
TxtCity.Printable := true;
|
||||
TxtState.Printable := true;
|
||||
try
|
||||
with PReport1 do
|
||||
begin
|
||||
FileName := SaveDialog1.FileName;
|
||||
|
||||
// starting printing document.
|
||||
BeginDoc;
|
||||
|
||||
Table1.Open;
|
||||
while not Table1.Eof do
|
||||
Print(PRPage1);
|
||||
|
||||
// save document.
|
||||
EndDoc;
|
||||
Table1.Close;
|
||||
end;
|
||||
finally
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
PRPage1.Visible := false;
|
||||
end;
|
||||
|
||||
procedure TForm1.PRGridPanel1BeforePrintChild(Sender: TObject;
|
||||
ACanvas: TPRCanvas; ACol, ARow: Integer; Rect: TRect);
|
||||
begin
|
||||
with Table1 do
|
||||
if not Table1.Eof then
|
||||
begin
|
||||
// setting text from current record.
|
||||
TxtCustNo.Text := Table1CustNo.AsString;
|
||||
TxtCompany.Text := Table1Company.AsString;
|
||||
TxtAddr.Text := Table1Addr1.AsString;
|
||||
TxtCity.Text := Table1City.AsString;
|
||||
TxtState.Text := Table1State.AsString;
|
||||
|
||||
// move next current record.
|
||||
Table1.Next;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TxtCustNo.Printable := false;
|
||||
TxtCompany.Printable := false;
|
||||
TxtAddr.Printable := false;
|
||||
TxtCity.Printable := false;
|
||||
TxtState.Printable := false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.About1Click(Sender: TObject);
|
||||
begin
|
||||
ShowMessage(POWER_PDF_VERSION_STR + #13#10 + POWER_PDF_COPYRIGHT);
|
||||
end;
|
||||
|
||||
procedure TForm1.Exit1Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user