|
|
unit u_sys_report_manage;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB, ADODB,
|
|
|
bsSkinShellCtrls, bsDialogs, ppEndUsr, ppProd, ppClass, ppReport,
|
|
|
ppDsgnDB, BusinessSkinForm, ppComm, ppRelatv, ppDB, ppDBPipe, bsSkinCtrls,
|
|
|
dxDBTLCl, dxGrClms, ExtCtrls, DBCtrls, StdCtrls, Mask, ComCtrls, RxMemDS,
|
|
|
TXComp,IdFTP,ShellApi, bsSkinTabs,IdFTPCommon;
|
|
|
|
|
|
type
|
|
|
Tfrm_sys_report_manage = class(TForm)
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
t_sys_report_lei: TADOQuery;
|
|
|
t_sys_report_lei1: TDataSource;
|
|
|
one_table_1: TppDBPipeline;
|
|
|
one_table_2: TppDBPipeline;
|
|
|
one_table_3: TppDBPipeline;
|
|
|
one_table_4: TppDBPipeline;
|
|
|
all_table_1: TppDBPipeline;
|
|
|
all_table_2: TppDBPipeline;
|
|
|
all_table_3: TppDBPipeline;
|
|
|
all_table_4: TppDBPipeline;
|
|
|
all_table_5: TppDBPipeline;
|
|
|
all_table_6: TppDBPipeline;
|
|
|
all_table_7: TppDBPipeline;
|
|
|
t_sys_report: TADOQuery;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
print_head: TppDBPipeline;
|
|
|
load_employee: TppDBPipeline;
|
|
|
ppDataDictionary1: TppDataDictionary;
|
|
|
t_sys_report1: TDataSource;
|
|
|
db_report: TppDBPipeline;
|
|
|
rp: TppReport;
|
|
|
rd: TppDesigner;
|
|
|
bsSkinInputDialog1: TbsSkinInputDialog;
|
|
|
t_one_table_1: TADOQuery;
|
|
|
t_one_table_11: TDataSource;
|
|
|
t_one_table_2: TADOQuery;
|
|
|
t_one_table_21: TDataSource;
|
|
|
t_one_table_31: TDataSource;
|
|
|
t_one_table_3: TADOQuery;
|
|
|
t_one_table_41: TDataSource;
|
|
|
t_one_table_4: TADOQuery;
|
|
|
t_all_table_1: TADOQuery;
|
|
|
t_all_table_11: TDataSource;
|
|
|
t_all_table_2: TADOQuery;
|
|
|
t_all_table_21: TDataSource;
|
|
|
t_all_table_3: TADOQuery;
|
|
|
t_all_table_31: TDataSource;
|
|
|
t_all_table_41: TDataSource;
|
|
|
t_all_table_4: TADOQuery;
|
|
|
t_all_table_5: TADOQuery;
|
|
|
t_all_table_51: TDataSource;
|
|
|
t_all_table_61: TDataSource;
|
|
|
t_all_table_6: TADOQuery;
|
|
|
t_all_table_71: TDataSource;
|
|
|
t_all_table_7: TADOQuery;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridColumn;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinNotebook1: TbsSkinNotebook;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label13: TLabel;
|
|
|
Panel1: TPanel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGrid2Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column2: TdxDBGridCheckColumn;
|
|
|
Panel2: TPanel;
|
|
|
bsSkinPanel6: TbsSkinPanel;
|
|
|
Label14: TLabel;
|
|
|
Panel3: TPanel;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
Label15: TLabel;
|
|
|
Panel4: TPanel;
|
|
|
dxDBGrid3: TdxDBGrid;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
t_down_list: TRxMemoryData;
|
|
|
t_down_list1: TDataSource;
|
|
|
Panel5: TPanel;
|
|
|
dxDBGrid4: TdxDBGrid;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
t_ask_report: TRxMemoryData;
|
|
|
t_ask_report1: TDataSource;
|
|
|
dxDBGrid4Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid4Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid4Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid4Column4: TdxDBGridColumn;
|
|
|
Edit1: TEdit;
|
|
|
Button2: TButton;
|
|
|
Edit2: TEdit;
|
|
|
Button3: TButton;
|
|
|
ExtraOptions1: TExtraOptions;
|
|
|
OpenDialog1: TOpenDialog;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
DBMemo1: TDBMemo;
|
|
|
DBMemo3: TDBMemo;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
Label2: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label10: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label12: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBRichEdit1: TDBRichEdit;
|
|
|
DBRichEdit2: TDBRichEdit;
|
|
|
DBRichEdit3: TDBRichEdit;
|
|
|
DBRichEdit4: TDBRichEdit;
|
|
|
DBRichEdit5: TDBRichEdit;
|
|
|
DBRichEdit6: TDBRichEdit;
|
|
|
DBRichEdit7: TDBRichEdit;
|
|
|
DBRichEdit8: TDBRichEdit;
|
|
|
DBRichEdit9: TDBRichEdit;
|
|
|
DBRichEdit10: TDBRichEdit;
|
|
|
DBRichEdit11: TDBRichEdit;
|
|
|
Button1: TButton;
|
|
|
DBMemo2: TDBMemo;
|
|
|
DBNavigator1: TDBNavigator;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinPanel2Resize(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
procedure t_sys_reportAfterInsert(DataSet: TDataSet);
|
|
|
procedure dxDBGrid1Click(Sender: TObject);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure Button2Click(Sender: TObject);
|
|
|
procedure Button3Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
procedure rdCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure dxDBGrid1KeyPress(Sender: TObject; var Key: Char);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_sys_report_manage: Tfrm_sys_report_manage;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_sys_print_view, u_data_share;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_sys_report_manage.Hide;
|
|
|
frm_sys_report_manage.ManualFloat(frm_sys_report_manage.BoundsRect );
|
|
|
frm_main.freeTabs('frm_sys_report_manage');
|
|
|
action:=cafree;
|
|
|
frm_sys_report_manage:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinPanel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(bsSkinPanel2.width/7);
|
|
|
bsSkinButton6.width:=i;
|
|
|
bsSkinButton3.width:=i;
|
|
|
bsSkinButton2.width:=i;
|
|
|
bsSkinButton1.width:=i;
|
|
|
bsSkinButton9.width:=i;
|
|
|
bsSkinButton4.width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
if t_sys_report.RecordCount<>0 then
|
|
|
rp.template.DatabaseSettings.name :='';
|
|
|
rp.AllowPrintToFile:=true;
|
|
|
rd.ShowModal;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
if t_sys_report.isempty then
|
|
|
exit;
|
|
|
try
|
|
|
rp.template.DatabaseSettings.Name:=t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
rp.template.LoadFromDatabase;
|
|
|
rp.AllowPrintToFile:=false;
|
|
|
|
|
|
if not assigned(frm_sys_print_view) then
|
|
|
frm_sys_print_view:=tfrm_sys_print_view.Create(self);
|
|
|
frm_sys_print_view.ppViewer1.Report:=rp;
|
|
|
rp.PrintToDevices;
|
|
|
frm_sys_print_view.ShowModal;
|
|
|
except
|
|
|
showmessage('<27><>ӡԤ<D3A1><D4A4>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
book1:Tbookmark;
|
|
|
str:string;
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
try
|
|
|
t_sys_report.DisableControls;
|
|
|
book1:=t_sys_report.GetBookmark;
|
|
|
str:=t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_sys_report.First;
|
|
|
while not t_sys_report.eof do
|
|
|
begin
|
|
|
if t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring=str then
|
|
|
begin
|
|
|
t_sys_report.edit;
|
|
|
t_sys_report['<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>']:=1;
|
|
|
t_sys_report.post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_sys_report.edit;
|
|
|
t_sys_report['<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>']:=0;
|
|
|
t_sys_report.post;
|
|
|
end;
|
|
|
t_sys_report.next;
|
|
|
end;
|
|
|
finally
|
|
|
t_sys_report.GotoBookmark(book1);
|
|
|
t_sys_report.EnableControls;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
if t_sys_report.isempty then
|
|
|
begin
|
|
|
showmessage('û<><C3BB>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶĸ<C6B5>ʽ<EFBFBD><CABD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_sys_report.edit;
|
|
|
t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsSkinInputDialog1.InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>',t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
t_sys_report.post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
if t_sys_report.isempty then
|
|
|
begin
|
|
|
showmessage('û<><C3BB>Ҫɾ<D2AA><C9BE><EFBFBD>ĸ<EFBFBD>ʽ<EFBFBD><CABD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
|
|
|
t_sys_report.delete;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.Active=false then
|
|
|
exit;
|
|
|
if t_sys_report.isempty then
|
|
|
begin
|
|
|
showmessage('û<><C3BB>Ҫ<EFBFBD><D2AA><EFBFBD>Ƶĸ<C6B5>ʽ<EFBFBD><CABD>');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
rp.template.DatabaseSettings.Name:=t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
rp.template.LoadFromDatabase;
|
|
|
rp.AllowPrintToFile:=true;
|
|
|
rd.ShowModal;
|
|
|
except
|
|
|
showmessage('<27><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_sys_report_lei.Open;
|
|
|
frm_data_share.t_sys_report_head.Requery();
|
|
|
frm_data_share.t_load_employee.Requery();
|
|
|
dxdbgrid1.FullExpand;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.Button1Click(Sender: TObject);
|
|
|
var
|
|
|
afield : variant;
|
|
|
i: Integer;
|
|
|
begin
|
|
|
if t_sys_report_lei.IsEmpty then
|
|
|
exit;
|
|
|
afield := vararraycreate([0,t_sys_report_lei.fieldcount-1],varvariant);
|
|
|
for i := 0 to (t_sys_report_lei.fieldcount-1) do
|
|
|
begin
|
|
|
afield[i] :=t_sys_report_lei.fields[i].value ;
|
|
|
end;
|
|
|
t_sys_report_lei.append;
|
|
|
for i := 0 to (t_sys_report_lei.fieldcount-1) do
|
|
|
begin
|
|
|
t_sys_report_lei.fields[i].value := afield[i] ;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.t_sys_reportAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.dxDBGrid1Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report_lei.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.Parameters[0].value:=t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_sys_report.open;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>1').asstring)='' then
|
|
|
begin
|
|
|
one_table_1.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_one_table_1.close;
|
|
|
t_one_table_1.sql.clear;
|
|
|
t_one_table_1.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>1').asstring);
|
|
|
t_one_table_1.open;
|
|
|
one_table_1.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>2').asstring)='' then
|
|
|
begin
|
|
|
one_table_2.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_one_table_2.close;
|
|
|
t_one_table_2.sql.clear;
|
|
|
t_one_table_2.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>2').asstring);
|
|
|
t_one_table_2.open;
|
|
|
one_table_2.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>3').asstring)='' then
|
|
|
begin
|
|
|
one_table_3.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_one_table_3.close;
|
|
|
t_one_table_3.sql.clear;
|
|
|
t_one_table_3.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>3').asstring);
|
|
|
t_one_table_3.open;
|
|
|
one_table_3.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>4').asstring)='' then
|
|
|
begin
|
|
|
one_table_4.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_one_table_4.close;
|
|
|
t_one_table_4.sql.clear;
|
|
|
t_one_table_4.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>4').asstring);
|
|
|
t_one_table_4.open;
|
|
|
one_table_4.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>5').asstring)='' then
|
|
|
begin
|
|
|
all_table_1.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_1.close;
|
|
|
t_all_table_1.sql.clear;
|
|
|
t_all_table_1.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>5').asstring);
|
|
|
t_all_table_1.open;
|
|
|
all_table_1.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>6').asstring)='' then
|
|
|
begin
|
|
|
all_table_2.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_2.close;
|
|
|
t_all_table_2.sql.clear;
|
|
|
t_all_table_2.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>6').asstring);
|
|
|
t_all_table_2.open;
|
|
|
all_table_2.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>7').asstring)='' then
|
|
|
begin
|
|
|
all_table_3.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_3.close;
|
|
|
t_all_table_3.sql.clear;
|
|
|
t_all_table_3.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>7').asstring);
|
|
|
t_all_table_3.open;
|
|
|
all_table_3.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>8').asstring)='' then
|
|
|
begin
|
|
|
all_table_4.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_4.close;
|
|
|
t_all_table_4.sql.clear;
|
|
|
t_all_table_4.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>8').asstring);
|
|
|
t_all_table_4.open;
|
|
|
all_table_4.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>9').asstring)='' then
|
|
|
begin
|
|
|
all_table_5.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_5.close;
|
|
|
t_all_table_5.sql.clear;
|
|
|
t_all_table_5.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>9').asstring);
|
|
|
t_all_table_5.open;
|
|
|
all_table_5.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>10').asstring)='' then
|
|
|
begin
|
|
|
all_table_6.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_6.close;
|
|
|
t_all_table_6.sql.clear;
|
|
|
t_all_table_6.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>10').asstring);
|
|
|
t_all_table_6.open;
|
|
|
all_table_6.Visible:=true;
|
|
|
end;
|
|
|
|
|
|
if trim(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>11').asstring)='' then
|
|
|
begin
|
|
|
all_table_7.Visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_all_table_7.close;
|
|
|
t_all_table_7.sql.clear;
|
|
|
t_all_table_7.sql.add(t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>11').asstring);
|
|
|
t_all_table_7.open;
|
|
|
all_table_7.Visible:=true;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton12Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinButton12.Caption='չ <20><>' then
|
|
|
begin
|
|
|
dxdbgrid1.FullExpand;
|
|
|
bsSkinButton12.Caption:='<27><> <20><>';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
dxdbgrid1.FullCollapse;
|
|
|
bsSkinButton12.Caption:='չ <20><>';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.Button2Click(Sender: TObject);
|
|
|
begin
|
|
|
if Edit1.text='xhdsoft'then
|
|
|
begin
|
|
|
bsSkinPanel3.Enabled:=true;
|
|
|
DBMemo2.ReadOnly:=false;
|
|
|
end
|
|
|
else
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.Button3Click(Sender: TObject);
|
|
|
begin
|
|
|
if Edit2.text='xhdsoft'then
|
|
|
begin
|
|
|
Panel4.Enabled:=true;
|
|
|
Panel5.Enabled:=true;
|
|
|
end
|
|
|
else
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
line:string;
|
|
|
k:integer;
|
|
|
IdFTP1: TIdFTP;
|
|
|
ListBox: TListBox;
|
|
|
begin
|
|
|
try
|
|
|
idftp1:=tidftp.Create(application);
|
|
|
listbox:=Tlistbox.Create(nil);
|
|
|
listbox.Visible:=false;
|
|
|
listbox.Parent:=frm_sys_report_manage;
|
|
|
t_ask_report.close;
|
|
|
t_ask_report.open;
|
|
|
with idftp1 do
|
|
|
begin
|
|
|
Username:='dongsheng';
|
|
|
Password:='zouwenkun';
|
|
|
Host:='218.57.11.18';
|
|
|
Connect;
|
|
|
end;
|
|
|
IdFTP1.ChangeDir('/XHD/REPORT');
|
|
|
IdFTP1.TransferType := ftASCII;
|
|
|
ListBox.Items.Clear;
|
|
|
IdFTP1.List(ListBox.Items);
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ʼ
|
|
|
if not DirectoryExists(ExtractFilePath(Application.ExeName)+'update') then
|
|
|
CreateDir(ExtractFilePath(Application.ExeName)+'update');
|
|
|
for k:=0 to listbox.Count -1 do
|
|
|
begin
|
|
|
try
|
|
|
Line:=ListBox.Items[k];
|
|
|
while pos(' ',line) <> 0 do
|
|
|
begin
|
|
|
delete(line,1,pos(' ',line));
|
|
|
end;
|
|
|
IdFTP1.TransferType := ftBinary;
|
|
|
IdFTP1.Get(line,ExtractFilePath(Application.ExeName)+'update\'+line,true);
|
|
|
t_ask_report.insert;
|
|
|
t_ask_report['<27><>˾']:=copy(line,1,pos('@',line)-1);
|
|
|
t_ask_report['<27><>Ա']:=copy(line,pos('@',line)+1,pos('%',line)-pos('@',line)-1);
|
|
|
t_ask_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=copy(line,pos('%',line)+1,pos('&',line)-pos('%',line)-1);
|
|
|
t_ask_report['<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>']:=line;
|
|
|
t_ask_report.post;
|
|
|
except
|
|
|
;
|
|
|
end;
|
|
|
//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
|
|
end;
|
|
|
finally
|
|
|
listbox.free;
|
|
|
idftp1.Disconnect;
|
|
|
idftp1.Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton10Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
str_rtm,do_file,str_tell:widestring;
|
|
|
begin
|
|
|
if t_sys_report.IsEmpty then
|
|
|
exit;
|
|
|
do_file:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>±<EFBFBD><C2B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>', ''));
|
|
|
if do_file='' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>±<EFBFBD><C2B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
str_tell:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD>뱨<EFBFBD><EBB1A8>˵<EFBFBD><CBB5>', '<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>', ''));
|
|
|
if str_tell='' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>±<EFBFBD><C2B1><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
exit;
|
|
|
end; //<2F><><EFBFBD><EFBFBD>^<5E><><EFBFBD><EFBFBD>#<23><><EFBFBD><EFBFBD>~˵<><CBB5>&.rtm
|
|
|
|
|
|
str_rtm:=t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'^'+do_file
|
|
|
+'#'+datetostr(date)
|
|
|
+'~'+str_tell
|
|
|
+'&.rtm';
|
|
|
try
|
|
|
rp.template.DatabaseSettings.Name:=t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
rp.template.LoadFromDatabase;
|
|
|
rp.AllowPrintToFile:=true;
|
|
|
rp.Template.FileName:=ExtractFilePath(Application.ExeName)+'update\'+str_rtm;
|
|
|
rp.Template.SaveToFile;
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
try
|
|
|
IdFTP1:=TIdFTP.Create(application);
|
|
|
with idftp1 do
|
|
|
begin
|
|
|
Username:='dongsheng';
|
|
|
Password:='zouwenkun';
|
|
|
Host:='218.57.11.18';
|
|
|
Connect;
|
|
|
end;
|
|
|
idftp1.ChangeDir('/XHD/REPORT');
|
|
|
idftp1.TransferType:=ftBinary;
|
|
|
idftp1.Put(ExtractFilePath(Application.ExeName)+'update\'+str_rtm,str_rtm);
|
|
|
idftp1.Disconnect;
|
|
|
except
|
|
|
;
|
|
|
end;
|
|
|
idftp1.Free;
|
|
|
showmessage('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton8Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
begin
|
|
|
if t_ask_report.IsEmpty then
|
|
|
exit;
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD><D2AA>fpt<70><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵĵ<CFB5>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)<>IDOK then
|
|
|
exit;
|
|
|
try
|
|
|
IdFTP1:=TIdFTP.Create(application);
|
|
|
with idftp1 do
|
|
|
begin
|
|
|
Username:='dongsheng';
|
|
|
Password:='zouwenkun';
|
|
|
Host:='218.57.11.18';
|
|
|
Connect;
|
|
|
end;
|
|
|
IdFTP1.ChangeDir('/XHD/REPORT');
|
|
|
IdFTP1.Delete(t_ask_report['<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>']);
|
|
|
t_ask_report.delete;
|
|
|
finally
|
|
|
idftp1.Disconnect;
|
|
|
idftp1.free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_ask_report.isempty then
|
|
|
exit;
|
|
|
ShellExecute(Application.Handle,nil,PChar(ExtractFilePath(Application.ExeName)+'update\'+t_ask_report.fieldbyname('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>').asstring),nil,nil,SW_NORMAL);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.rdCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
if rd.Report.Modified then
|
|
|
begin
|
|
|
case Application.MessageBox('<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>汨<EFBFBD><E6B1A8><EFBFBD><EFBFBD>','<27><>ʾ',MB_YESNOCANCEL + MB_ICONINFORMATION) of
|
|
|
IDYES:
|
|
|
begin
|
|
|
rd.Report.Template.SaveToDatabase;
|
|
|
CanClose:=True;
|
|
|
end;
|
|
|
IDNO: CanClose:=True;
|
|
|
IDCANCEL: CanClose:=False;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_sys_report_manage.dxDBGrid1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key='@'then
|
|
|
begin
|
|
|
bsSkinNotebook1.PageIndex:=0;
|
|
|
end;
|
|
|
if key='#'then
|
|
|
begin
|
|
|
bsSkinNotebook1.PageIndex:=1;
|
|
|
end;
|
|
|
if key='$'then
|
|
|
begin
|
|
|
bsSkinNotebook1.PageIndex:=2;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|