123 lines
3.2 KiB
ObjectPascal
123 lines
3.2 KiB
ObjectPascal
|
unit U_PrintLabFun;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
ADODB, System.SysUtils, Vcl.Forms;
|
|||
|
|
|||
|
procedure PrintServerLabel(ADO_Prt: TADOQuery; mSheets, mprintFlag, mprinter: Integer; FFiltration1: string);
|
|||
|
|
|||
|
procedure PrintServerLabelStkId(ADO_Prt: TADOQuery; mSheets, mprintFlag, mprinter: Integer; FFiltration1: string);
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_printPdf, U_RTFun, U_DataLink;
|
|||
|
|
|||
|
procedure PrintServerLabel(ADO_Prt: TADOQuery; mSheets, mprintFlag, mprinter: Integer; FFiltration1: string);
|
|||
|
var
|
|||
|
MaxBLCLID, LBName: string;
|
|||
|
WBoolean: Boolean;
|
|||
|
i: Integer;
|
|||
|
Mmessage, MpdfFileId, Mcode: string;
|
|||
|
begin
|
|||
|
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' EXEC P_Trade_Card_Prt1 ');
|
|||
|
SQL.Add(' @Filtration=''' + Trim(FFiltration1) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADO_Prt.IsEmpty then
|
|||
|
begin
|
|||
|
raise Exception.Create('<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD>!');
|
|||
|
end;
|
|||
|
LBName := Trim(ADO_Prt.fieldbyname('LabVolume').AsString);
|
|||
|
try
|
|||
|
if GetLSNo(ADO_Prt, MaxBLCLID, 'L', 'Bs_Report_Cloud_Log', 4, 1) = False then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from Bs_Report_Cloud_Log where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('BLCLID').Value := MaxBLCLID;
|
|||
|
FieldByName('Filler').Value := dname;
|
|||
|
FieldByName('LMName').Value := LBName;
|
|||
|
FieldByName('LMSql1').Value := 'P_Trade_Card_Prt1';
|
|||
|
FieldByName('Filtration1').Value := Trim(FFiltration1);
|
|||
|
FieldByName('IsSql1').Value := 0;
|
|||
|
FieldByName('Sheets').Value := mSheets;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
printPdf(Application, 1, PChar('title'), PChar(dcode), PChar(dname), PChar(MaxBLCLID), mSheets, mprintFlag, mprinter, PChar(DConString));
|
|||
|
except
|
|||
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure PrintServerLabelStkId(ADO_Prt: TADOQuery; mSheets, mprintFlag, mprinter: Integer; FFiltration1: string);
|
|||
|
var
|
|||
|
MaxBLCLID, LBName: string;
|
|||
|
WBoolean: Boolean;
|
|||
|
i: Integer;
|
|||
|
Mmessage, MpdfFileId, Mcode: string;
|
|||
|
begin
|
|||
|
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' EXEC P_Trade_Cloth_Prt_Lab ');
|
|||
|
SQL.Add(' @Filtration=''' + Trim(FFiltration1) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADO_Prt.IsEmpty then
|
|||
|
begin
|
|||
|
raise Exception.Create('<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD>!');
|
|||
|
end;
|
|||
|
LBName := Trim(ADO_Prt.fieldbyname('LabVolume').AsString);
|
|||
|
try
|
|||
|
if GetLSNo(ADO_Prt, MaxBLCLID, 'L', 'Bs_Report_Cloud_Log', 4, 1) = False then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from Bs_Report_Cloud_Log where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADO_Prt do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('BLCLID').Value := MaxBLCLID;
|
|||
|
FieldByName('Filler').Value := dname;
|
|||
|
FieldByName('LMName').Value := LBName;
|
|||
|
FieldByName('LMSql1').Value := 'P_Trade_Cloth_Prt_Lab';
|
|||
|
FieldByName('Filtration1').Value := Trim(FFiltration1);
|
|||
|
FieldByName('IsSql1').Value := 0;
|
|||
|
FieldByName('Sheets').Value := mSheets;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
printPdf(Application, 1, PChar('title'), PChar(dcode), PChar(dname), PChar(MaxBLCLID), mSheets, mprintFlag, mprinter, PChar(DConString));
|
|||
|
except
|
|||
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|