Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KGOrders
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cam Hayes
KGOrders
Commits
07ecb704
Commit
07ecb704
authored
Dec 26, 2024
by
Elias Sarraf
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into cam2
parents
afced290
d39dc485
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
274 additions
and
63 deletions
+274
-63
Data.dfm
kgOrdersServer/Source/Data.dfm
+10
-2
Data.pas
kgOrdersServer/Source/Data.pas
+27
-24
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+1
-1
rOrders.dfm
kgOrdersServer/Source/rOrders.dfm
+0
-0
rOrders.pas
kgOrdersServer/Source/rOrders.pas
+232
-31
rptOrders.fr3
kgOrdersServer/Source/rptOrders.fr3
+0
-0
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+4
-5
No files found.
kgOrdersServer/Source/Data.dfm
View file @
07ecb704
...
@@ -1276,7 +1276,7 @@ object FData: TFData
...
@@ -1276,7 +1276,7 @@ object FData: TFData
PrintFont.Style = []
PrintFont.Style = []
Width = 64
Width = 64
end>
end>
DataSource = ds
Recordings
DataSource = ds
Grid2
InvalidPicture.Data = {
InvalidPicture.Data = {
055449636F6E0000010001002020200000000000A81000001600000028000000
055449636F6E0000010001002020200000000000A81000001600000028000000
2000000040000000010020000000000000100000000000000000000000000000
2000000040000000010020000000000000100000000000000000000000000000
...
@@ -1509,7 +1509,8 @@ object FData: TFData
...
@@ -1509,7 +1509,8 @@ object FData: TFData
Left = 482
Left = 482
Top = 459
Top = 459
end
end
object dsRecordings: TDataSource
object dsGrid2: TDataSource
DataSet = rptOrders.uqOrders
Left = 348
Left = 348
Top = 472
Top = 472
end
end
...
@@ -1519,4 +1520,11 @@ object FData: TFData
...
@@ -1519,4 +1520,11 @@ object FData: TFData
Left = 669
Left = 669
Top = 456
Top = 456
end
end
object Timer1: TTimer
Enabled = False
Interval = 100
OnTimer = Timer1Timer
Left = 348
Top = 369
end
end
end
kgOrdersServer/Source/Data.pas
View file @
07ecb704
//
Uses Twilio.Data.Module for the rest api calls. Simply f
or testing querys.
//
F
or testing querys.
// Visual aspect is for testing purposes only and has no affect on the client.
// Visual aspect is for testing purposes only and has no affect on the client.
// Authors:
// Authors:
// Cameron Hayes
// Cameron Hayes
...
@@ -14,7 +14,7 @@ uses
...
@@ -14,7 +14,7 @@ uses
BaseGrid
,
AdvGrid
,
DBAdvGrid
,
MemDS
,
DBAccess
,
Uni
,
Vcl
.
StdCtrls
,
Vcl
.
Mask
,
BaseGrid
,
AdvGrid
,
DBAdvGrid
,
MemDS
,
DBAccess
,
Uni
,
Vcl
.
StdCtrls
,
Vcl
.
Mask
,
vcl
.
wwdbedit
,
vcl
.
wwdotdot
,
vcl
.
wwdbcomb
,
REST
.
Client
,
REST
.
Types
,
System
.
JSON
,
vcl
.
wwdbedit
,
vcl
.
wwdotdot
,
vcl
.
wwdbcomb
,
REST
.
Client
,
REST
.
Types
,
System
.
JSON
,
System
.
Generics
.
Collections
,
AdvEdit
,
vcl
.
wwdblook
,
vcl
.
wwdbdatetimepicker
,
System
.
Generics
.
Collections
,
AdvEdit
,
vcl
.
wwdblook
,
vcl
.
wwdbdatetimepicker
,
System
.
Hash
,
Api
.
Database
;
System
.
Hash
,
Api
.
Database
,
Vcl
.
ExtCtrls
;
type
type
TFData
=
class
(
TForm
)
TFData
=
class
(
TForm
)
...
@@ -23,7 +23,7 @@ type
...
@@ -23,7 +23,7 @@ type
Memo1
:
TMemo
;
Memo1
:
TMemo
;
DBAdvGrid1
:
TDBAdvGrid
;
DBAdvGrid1
:
TDBAdvGrid
;
DBAdvGrid2
:
TDBAdvGrid
;
DBAdvGrid2
:
TDBAdvGrid
;
ds
Recordings
:
TDataSource
;
ds
Grid2
:
TDataSource
;
edtUsername
:
TEdit
;
edtUsername
:
TEdit
;
edtPassword
:
TEdit
;
edtPassword
:
TEdit
;
lblHash
:
TLabel
;
lblHash
:
TLabel
;
...
@@ -35,15 +35,17 @@ type
...
@@ -35,15 +35,17 @@ type
edtPhoneNumber
:
TEdit
;
edtPhoneNumber
:
TEdit
;
edtEmailAddress
:
TEdit
;
edtEmailAddress
:
TEdit
;
btnPDF
:
TButton
;
btnPDF
:
TButton
;
Timer1
:
TTimer
;
procedure
FormCreate
(
Sender
:
TObject
);
procedure
FormCreate
(
Sender
:
TObject
);
procedure
btnFindClick
(
Sender
:
TObject
);
procedure
btnFindClick
(
Sender
:
TObject
);
procedure
btnPDFClick
(
Sender
:
TObject
);
procedure
btnPDFClick
(
Sender
:
TObject
);
procedure
Timer1Timer
(
Sender
:
TObject
);
private
private
kgDB
:
TApiDatabase
;
kgDB
:
TApiDatabase
;
accountSID
:
string
;
accountSID
:
string
;
authHeader
:
string
;
authHeader
:
string
;
public
public
function
GetReportPDF
(
OrderID
:
string
):
string
;
procedure
RunOrdersReport
(
searchOptions
:
string
)
;
end
;
end
;
var
var
...
@@ -55,17 +57,29 @@ implementation
...
@@ -55,17 +57,29 @@ implementation
uses
uLibrary
,
rOrders
;
uses
uLibrary
,
rOrders
;
procedure
TFData
.
btnPDFClick
(
Sender
:
TObject
);
procedure
TFData
.
FormCreate
(
Sender
:
TObject
);
begin
begin
GetReportPDF
(
''
)
;
Timer1
.
Enabled
:=
True
;
end
;
end
;
procedure
TFData
.
FormCreate
(
Sender
:
TObject
);
procedure
TFData
.
Timer1Timer
(
Sender
:
TObject
);
begin
begin
Timer1
.
Enabled
:=
False
;
Screen
.
Cursor
:=
crHourGlass
;
Memo1
.
Lines
.
Add
(
'creating kgDB TApiDatabase...'
);
kgDB
:=
TApiDatabase
.
Create
(
Self
);
kgDB
:=
TApiDatabase
.
Create
(
Self
);
Memo1
.
Lines
.
Add
(
'--kgDB TApiDatabase created!'
);
Screen
.
Cursor
:=
crDefault
;
end
;
end
;
procedure
TFData
.
btnPDFClick
(
Sender
:
TObject
);
begin
RunOrdersReport
(
'&pagenumber=1&pagesize=50&orderby='
);
end
;
procedure
TFData
.
btnFindClick
(
Sender
:
TObject
);
procedure
TFData
.
btnFindClick
(
Sender
:
TObject
);
// Retrieves calls from a specific number from the database.
// Retrieves calls from a specific number from the database.
// SQL: SQL statement to retrieve calls from the database
// SQL: SQL statement to retrieve calls from the database
...
@@ -84,27 +98,16 @@ begin
...
@@ -84,27 +98,16 @@ begin
end
;
end
;
function
TFData
.
GetReportPDF
(
OrderID
:
string
):
string
;
procedure
TFData
.
RunOrdersReport
(
searchOptions
:
string
)
;
var
var
rptOrders
:
TrptOrders
;
// Local instance
rptOrders
:
TrptOrders
;
OrderIDList
:
TStringList
;
begin
begin
rptOrders
:=
TrptOrders
.
Create
(
nil
);
// Always create locally
rptOrders
:=
TrptOrders
.
Create
(
nil
);
try
try
// Create a list of hardcoded OrderIDs for testing
rptOrders
.
PrepareReport
(
searchOptions
);
OrderIDList
:=
TStringList
.
Create
;
dsGrid2
.
DataSet
:=
rptOrders
.
uqOrders
;
try
OrderIDList
.
Add
(
'18995'
);
OrderIDList
.
Add
(
'18994'
);
OrderIDList
.
Add
(
'18993'
);
// Add more OrderIDs as needed
// Generate the PDF Report with the list of OrderIDs
rptOrders
.
GenerateSimpleReport
(
350
);
finally
OrderIDList
.
Free
;
// Free the TStringList
end
;
finally
finally
rptOrders
.
Free
;
// Ensure rptOrders is freed
rptOrders
.
Free
;
end
;
end
;
end
;
end
;
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
07ecb704
...
@@ -188,7 +188,7 @@ begin
...
@@ -188,7 +188,7 @@ begin
// Optionally, log success
// Optionally, log success
Logger
.
log
(
5
,
'PDF Report successfully generated for searchOptions: '
+
searchOptions
);
Logger
.
log
(
5
,
'PDF Report successfully generated for searchOptions: '
+
searchOptions
);
finally
finally
rptOrders
.
Free
;
// Ensure proper cleanup
rptOrders
.
Free
;
end
;
end
;
end
;
end
;
...
...
kgOrdersServer/Source/rOrders.dfm
View file @
07ecb704
This diff is collapsed.
Click to expand it.
kgOrdersServer/Source/rOrders.pas
View file @
07ecb704
...
@@ -5,7 +5,7 @@ interface
...
@@ -5,7 +5,7 @@ interface
uses
uses
System
.
SysUtils
,
System
.
Classes
,
frxClass
,
frxExportBaseDialog
,
frxExportPDF
,
System
.
SysUtils
,
System
.
Classes
,
frxClass
,
frxExportBaseDialog
,
frxExportPDF
,
Data
.
DB
,
DBAccess
,
Uni
,
UniProvider
,
MySQLUniProvider
,
System
.
IniFiles
,
Vcl
.
Forms
,
Data
.
DB
,
DBAccess
,
Uni
,
UniProvider
,
MySQLUniProvider
,
System
.
IniFiles
,
Vcl
.
Forms
,
MemDS
,
frxDBSet
,
frxTableObject
,
frCoreClasses
,
Common
.
Logging
,
System
.
IOUtils
;
MemDS
,
frxDBSet
,
frxTableObject
,
frCoreClasses
,
Common
.
Logging
,
System
.
IOUtils
,
JSON
;
type
type
TrptOrders
=
class
(
TDataModule
)
TrptOrders
=
class
(
TDataModule
)
...
@@ -13,15 +13,38 @@ type
...
@@ -13,15 +13,38 @@ type
frxPDFExport1
:
TfrxPDFExport
;
frxPDFExport1
:
TfrxPDFExport
;
ucKG
:
TUniConnection
;
ucKG
:
TUniConnection
;
uqOrders
:
TUniQuery
;
uqOrders
:
TUniQuery
;
frxReportTableObject1
:
TfrxReportTableObject
;
frxDBOrders
:
TfrxDBDataset
;
frxDBOrders
:
TfrxDBDataset
;
uqOrdersORDER_ID
:
TLongWordField
;
uqOrdersLoc
:
TStringField
;
uqOrdersCOMPANY_NAME
:
TStringField
;
uqOrdersJOB_NAME
:
TStringField
;
uqOrdersORDER_DATE
:
TDateTimeField
;
uqOrdersORDER_TYPE
:
TStringField
;
uqOrdersPROOF_DUE
:
TDateField
;
uqOrdersPROOF_DONE
:
TDateTimeField
;
uqOrdersART_DUE
:
TDateField
;
uqOrdersART_DONE
:
TDateTimeField
;
uqOrdersPLATE_DUE
:
TDateField
;
uqOrdersPLATE_DONE
:
TDateTimeField
;
uqOrdersMOUNT_DUE
:
TDateField
;
uqOrdersMOUNT_DONE
:
TDateTimeField
;
uqOrdersSHIP_DUE
:
TDateField
;
uqOrdersSHIP_DONE
:
TDateTimeField
;
uqOrdersPRICE
:
TFloatField
;
uqOrdersQB_REF_NUM
:
TStringField
;
uqOrdersCOLORS
:
TStringField
;
uqColors
:
TUniQuery
;
procedure
DataModuleCreate
(
Sender
:
TObject
);
procedure
DataModuleCreate
(
Sender
:
TObject
);
procedure
uqOrdersCalcFields
(
DataSet
:
TDataSet
);
private
private
function
BuildOrderQuery
(
searchOptions
:
string
):
string
;
function
generateSubQuery
(
filterType
,
statusType
,
currStatus
:
string
):
string
;
function
getColorCount
(
colors
:
string
):
string
;
public
public
procedure
GenerateSimpleReport
(
OrderID
:
Integer
);
procedure
PrepareReport
(
searchOptions
:
string
);
procedure
PrepareReport
(
const
SQL
:
string
);
procedure
GeneratePDF
;
procedure
GeneratePDF
;
end
;
end
;
...
@@ -51,61 +74,239 @@ begin
...
@@ -51,61 +74,239 @@ begin
end
;
end
;
end
;
end
;
procedure
TrptOrders
.
GenerateSimpleReport
(
OrderID
:
Integer
);
procedure
TrptOrders
.
PrepareReport
(
searchOptions
:
string
);
var
SQL
:
string
;
begin
begin
SQL
:=
BuildOrderQuery
(
searchOptions
);
Logger
.
Log
(
5
,
'Generated SQL for Prepare Report: '
+
SQL
);
uqOrders
.
Close
;
uqOrders
.
SQL
.
Text
:=
SQL
;
uqOrders
.
Open
;
GeneratePDF
;
Logger
.
Log
(
5
,
'Report preparation complete.'
);
end
;
procedure
TrptOrders
.
uqOrdersCalcFields
(
DataSet
:
TDataSet
);
var
ColorType
:
string
;
SQL
:
string
;
OrderID
:
LongWord
;
jsonStr
:
string
;
begin
OrderID
:=
uqOrdersORDER_ID
.
AsInteger
;
if
uqOrdersORDER_TYPE
.
AsString
=
'web_plate'
then
begin
ColorType
:=
'quantity_and_colors_qty_colors'
;
SQL
:=
'SELECT '
+
ColorType
+
' FROM web_plate_orders WHERE order_id = '
+
IntToStr
(
OrderID
);
end
else
begin
ColorType
:=
'colors_colors'
;
SQL
:=
'SELECT '
+
ColorType
+
' FROM corrugated_plate_orders WHERE order_id = '
+
IntToStr
(
OrderID
);
end
;
uqColors
.
Close
;
uqColors
.
SQL
.
Text
:=
SQL
;
try
try
Logger
.
Log
(
5
,
'Generating Report for Order ID: '
+
OrderID
.
ToString
);
uqColors
.
Open
;
jsonStr
:=
uqColors
.
FieldByName
(
ColorType
).
AsString
;
DataSet
.
FieldByName
(
'COLORS'
).
AsString
:=
getColorCount
(
jsonStr
);
finally
uqColors
.
Close
;
// Ensure it is closed
end
;
end
;
uqOrders
.
Close
;
uqOrders
.
SQL
.
Text
:=
'SELECT ORDER_ID FROM corrugated_plate_orders WHERE ORDER_ID = :OrderID'
;
uqOrders
.
ParamByName
(
'OrderID'
).
AsInteger
:=
OrderID
;
function
TrptOrders
.
getColorCount
(
colors
:
string
):
string
;
var
colorObject
:
TJSONObject
;
colorList
:
TJSONArray
;
begin
if
colors
=
''
then
result
:=
'0'
else
begin
colorObject
:=
TJSONObject
.
ParseJSONValue
(
colors
)
as
TJSONObject
;
try
try
uqOrders
.
Open
;
colorList
:=
TJSONArray
(
colorObject
.
GetValue
(
'items'
));
except
result
:=
IntToStr
(
colorList
.
Count
);
on
E
:
Exception
do
finally
begin
colorObject
.
Free
;
// Free TJSONObject to avoid leaks
Logger
.
Log
(
1
,
'Error executing query: '
+
E
.
Message
);
Exit
;
end
;
end
;
end
;
end
;
end
;
frxOrders
.
PrepareReport
;
frxOrders
.
ShowReport
;
// Builds a dynamic SQL query based on the search options
function
TrptOrders
.
BuildOrderQuery
(
searchOptions
:
string
):
string
;
var
params
:
TStringList
;
PageNum
,
PageSize
:
Integer
;
startDate
,
endDate
,
filterType
,
statusType
,
statusSuffix
:
string
;
statusTableShort
,
statusTableLong
,
whereSQL
,
SQL
:
string
;
begin
params
:=
TStringList
.
Create
;
try
params
.
StrictDelimiter
:=
True
;
params
.
Delimiter
:=
'&'
;
params
.
DelimitedText
:=
searchOptions
;
// Parse parameters
PageNum
:=
StrToIntDef
(
params
.
Values
[
'pagenumber'
],
1
);
PageSize
:=
StrToIntDef
(
params
.
Values
[
'pagesize'
],
50
);
startDate
:=
params
.
Values
[
'startDate'
];
endDate
:=
params
.
Values
[
'endDate'
];
filterType
:=
params
.
Values
[
'filterType'
];
statusType
:=
''
;
statusSuffix
:=
''
;
if
filterType
<>
''
then
begin
statusType
:=
filterType
.
Split
([
'_'
])[
0
];
statusSuffix
:=
filterType
.
Split
([
'_'
])[
1
];
filterType
:=
statusType
+
'_'
+
statusSuffix
;
end
;
// Determine which status table to use
if
statusSuffix
=
'DUE'
then
begin
statusTableShort
:=
'oss'
;
statusTableLong
:=
'orders_status_schedule'
;
end
else
begin
statusTableShort
:=
'os'
;
statusTableLong
:=
'orders_status'
;
end
;
SQL
:=
'SELECT o.ORDER_ID, '
;
if
filterType
<>
''
then
SQL
:=
SQL
+
statusTableShort
+
'.STATUS_DATE AS '
+
filterType
.
ToUpper
+
', '
;
SQL
:=
SQL
+
'o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, o.ORDER_TYPE, '
;
SQL
:=
SQL
+
generateSubQuery
(
filterType
,
statusType
,
'PROOF'
);
SQL
:=
SQL
+
generateSubQuery
(
filterType
,
statusType
,
'ART'
);
SQL
:=
SQL
+
generateSubQuery
(
filterType
,
statusType
,
'PLATE'
);
SQL
:=
SQL
+
generateSubQuery
(
filterType
,
statusType
,
'MOUNT'
);
SQL
:=
SQL
+
generateSubQuery
(
filterType
,
statusType
,
'SHIP'
);
SQL
:=
SQL
+
'o.PRICE, qb.QB_REF_NUM '
+
'FROM orders o '
+
'JOIN '
+
statusTableLong
+
' '
+
statusTableShort
+
' ON '
+
statusTableShort
+
'.ORDER_ID = o.ORDER_ID '
+
'JOIN customers c ON c.CUSTOMER_ID = o.COMPANY_ID '
+
'LEFT JOIN qb_sales_orders qb ON qb.ORDER_ID = o.ORDER_ID '
;
whereSQL
:=
'WHERE 1=1 '
;
if
startDate
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.ORDER_DATE >= '
+
QuotedStr
(
startDate
);
if
endDate
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.ORDER_DATE <= '
+
QuotedStr
(
endDate
);
if
statusType
<>
''
then
whereSQL
:=
whereSQL
+
' AND '
+
statusTableShort
+
'.ORDER_STATUS = '
+
QuotedStr
(
statusType
);
SQL
:=
SQL
+
whereSQL
;
SQL
:=
SQL
+
' ORDER BY o.ORDER_DATE DESC '
+
'LIMIT '
+
IntToStr
(
PageSize
)
+
' OFFSET '
+
IntToStr
((
PageNum
-
1
)
*
PageSize
);
Result
:=
SQL
;
finally
finally
uqOrders
.
Close
;
params
.
Free
;
frxOrders
.
Clear
;
Logger
.
Log
(
5
,
'Report generation complete for Order ID: '
+
OrderID
.
ToString
);
end
;
end
;
end
;
end
;
procedure
TrptOrders
.
PrepareReport
(
const
SQL
:
string
);
function
TrptOrders
.
generateSubQuery
(
filterType
,
statusType
,
currStatus
:
string
):
string
;
var
statusSuffix
:
string
;
begin
begin
// Prepare and load data into the query
Result
:=
''
;
uqOrders
.
Close
;
statusSuffix
:=
''
;
uqOrders
.
SQL
.
Text
:=
SQL
;
if
filterType
<>
''
then
uqOrders
.
Open
;
statusSuffix
:=
filterType
.
Split
([
'_'
])[
1
];
if
statusType
<>
currStatus
then
begin
if
(
statusSuffix
=
'DUE'
)
or
(
statusSuffix
=
''
)
then
begin
Result
:=
Result
+
'(SELECT oss.STATUS_DATE FROM orders_status_schedule oss '
+
'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = '
+
QuotedStr
(
currStatus
)
+
') AS '
+
currStatus
+
'_DUE, '
;
end
else
begin
Result
:=
Result
+
'(SELECT os.STATUS_TIMESTAMP FROM orders_status os '
+
'WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = '
+
QuotedStr
(
currStatus
)
+
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS '
+
currStatus
+
'_DONE, '
;
end
;
end
;
if
(
statusSuffix
=
'DUE'
)
or
(
statusSuffix
=
''
)
then
begin
Result
:=
Result
+
'(SELECT os.STATUS_TIMESTAMP FROM orders_status os '
+
'WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = '
+
QuotedStr
(
currStatus
)
+
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS '
+
currStatus
+
'_DONE, '
;
end
else
begin
Result
:=
Result
+
'(SELECT oss.STATUS_DATE FROM orders_status_schedule oss '
+
'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = '
+
QuotedStr
(
currStatus
)
+
') AS '
+
currStatus
+
'_DUE, '
;
end
;
end
;
end
;
//create new field called color count
procedure
TrptOrders
.
GeneratePDF
;
procedure
TrptOrders
.
GeneratePDF
;
var
var
ReportDir
,
ReportFileName
:
string
;
ReportDir
,
ReportFileName
:
string
;
begin
begin
ReportDir
:=
'C:\Projects\KGOrders\Reports'
;
ReportDir
:=
'C:\Projects\KGOrders\Reports'
;
// Define output file
if
not
DirectoryExists
(
ReportDir
)
then
begin
ForceDirectories
(
ReportDir
);
Logger
.
Log
(
5
,
'Reports directory created: '
+
ReportDir
);
end
;
ReportFileName
:=
TPath
.
Combine
(
ReportDir
,
'OrderReport_'
+
FormatDateTime
(
'yyyymmdd_hhnnss'
,
Now
)
+
'.pdf'
);
ReportFileName
:=
TPath
.
Combine
(
ReportDir
,
'OrderReport_'
+
FormatDateTime
(
'yyyymmdd_hhnnss'
,
Now
)
+
'.pdf'
);
// Prepare and export the report
frxOrders
.
PrepareReport
;
frxPDFExport1
.
FileName
:=
ReportFileName
;
frxPDFExport1
.
FileName
:=
ReportFileName
;
frxPDFExport1
.
ShowDialog
:=
False
;
frxPDFExport1
.
ShowDialog
:=
False
;
frxOrders
.
Export
(
frxPDFExport1
);
try
frxOrders
.
ShowPreparedReport
;
frxOrders
.
PrepareReport
;
frxOrders
.
Export
(
frxPDFExport1
);
frxOrders
.
ShowPreparedReport
;
finally
frxOrders
.
Clear
;
// Clear the report to avoid memory bloat
end
;
Logger
.
Log
(
5
,
'PDF saved to: '
+
ReportFileName
);
Logger
.
Log
(
5
,
'PDF saved to: '
+
ReportFileName
);
end
;
end
;
end
.
end
.
kgOrdersServer/Source/rptOrders.fr3
View file @
07ecb704
This diff is collapsed.
Click to expand it.
kgOrdersServer/kgOrdersServer.ini
View file @
07ecb704
[Settings]
[Settings]
MemoLogLevel
=
4
MemoLogLevel
=
4
FileLogLevel
=
5
FileLogLevel
=
5
LogFileNum
=
15
5
LogFileNum
=
3
5
webClientVersion
=
1.0.0
webClientVersion
=
1.0.0
[Database]
[Database]
Server
=
192.168.159.132
--
Server
=
192.168.159.132
--Server
=
192.168.60.129
Server
=
192.168.100.130
--Server
=
192.168.75.133
--Server
=
192.168.75.133
--Database
=
--Database
=
--Username
=
--Username
=
--Password
=
emsys!012
Password
=
emsys!012
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment