se (Sender: TObject; var Action: TCloseAction); BitBtn2Click (Sender: TObject); BitBtn5Click (Sender:TObject); RadioButton1Click (Sender: TObject); RadioButton2Click (Sender: TObject); BitBtn1Click (Sender: TObject); BitBtn6Click (Sender: TObject); BitBtn8Click (Sender: TObject); BitBtn7Click (Sender: TObject);
{Private declarations}
{Public declarations} ;: TForm1 ;: OleVariant;
//MyDir: String;: String ;: string;
implementation
{$ R * .dfm} TForm1.BitBtn3Click (Sender: TObject);
begin.Filtered:=false ;;
procedure TForm1.BitBtn4Click (Sender: TObject);
beginMessageDlg ( Ви дійсно хочете закрити програму? , mtConfirmation, [mbOK, mbCancel], 0)=mrCancel then Abort; .Terminate ;;
procedure TForm1.FormClose (Sender: TObject; var Action: TCloseAction);
beginMessageDlg ( Ви дійсно хочете закрити програму? , mtConfirmation, [mbOK, mbCancel], 0)=mrCancel then Abort; .Terminate ;;
procedure TForm1.BitBtn2Click (Sender: TObject);
var: Variant;
//bm: TBookmark ;, row, i: Integer ;: string ;: TMemo ;: cardinal ;: PChar ;: boolean;, Workbook, Colum, Sheet: OLEVariant;, cn, un: String;
begin:=MAX_COMPUTERNAME_LENGTH + 1;
PRes:=StrAlloc (Size);:=GetComputerName (PRes, Size); BRes then cn:=StrPas (PRes);:=MAX_COMPUTERNAME_LENGTH + 1;:=StrAlloc (Size);:= GetUserName (PRes, Size); BRes then un:=StrPas (PRes) ;. Cursor:=crArrow; .DataSource.DataSet.DisableControls; .DataSource.DataSet.First;:=1;
//створюємо об'єкт Excel:=CreateOleObject ( excel.application );
Excelapp.Application.EnableEvents:=false; .WorkBooks.Add (xlWBatWorkSheet);
ExcelApp.WorkBooks [1] .WorkSheets [1] .name:= Звіт raquo ;;. Visible:=false;
Colum:=ExcelApp.Workbooks [1] .WorkSheets [ Звіт ]. Columns;
for col:=0 to DBGrid1.FieldCount - 1 doDBGrid1.Columns [col] .Visible then begin.Columns[i].ColumnWidth:=25;Inc(i);;:=ExcelApp.Workbooks[1].WorkSheets[laquo;Отчётraquo;].Rows;
Colum.Rows [2] .Font.Bold:=true;
Colum.Rows[2].Font.Size:=8;.Rows[1].Font.Bold:=true;.Rows[1].Font.Color:=0;.Rows[1].Font.Size:=10;
ExcelApp.Visible:=false;:=TMemo.Create (Self);
mem.Visible:=false; .Parent:=Form1; .Clear;:= raquo ;;:=( Дані по бібліотеці + # 9 + DateToStr (date) + # 9 + TimeToStr (Time)) ;. Lines.Add (sline);:= raquo ;; col:=0 to DBGrid1.FieldCount - 1 doDBGrid1.Columns [col] .Visible then:=sline + form1.DBGrid1. Columns [col] .Title.Caption + # 9; .Lines.Add (sline) ;. Lines.Add ( ); row:=0 to form1.DBGrid1.DataSource.DataSet.RecordCount - 1 do:= raquo ;; col:=0 to form1.DBGrid1.FieldCount - 1 doform1.DBGrid1.Columns [col] .Visible then:=sline + form1.DBGrid1.Fields [col] .AsString + # 9; .Lines.Add (sline);
form1.DBGrid1.DataSource.DataSet.Next;
if form1.DBGrid1.DataSource.DataSet.Eof then Break ;;. SelectAll; .CopyToClipboard; .Visible:=true;.Workbooks[1].WorkSheets[laquo;Отчётraquo;].Paste;;.Free;.DBGrid1.DataSource.DataSet.EnableControls;.Cursor :=CrArrow ;;; end;
procedure TForm1.BitBtn5Click (Sender: TObject);
beginADOTable1.Locate(laquo;avtorraquo;,Edit1.Text,[loCaseInsensitive,loPartialKey]) then DBGrid1.SetFocus else ( пошук не дав результатів , mtConfirmation, [mbOK], 0) ;;
procedure TForm1.RadioButton1Click (Sender: TObject);
begin.Filter:=laquo;izdatelstvo=raquo;+laquo;raquo;laquo;raquo;+Edit1.Text+laquo;raquo;laquo;raquo;;.Filtered:=true;
end; TForm1.RadioButton2Click (Sender: TObject);
begin.Filter:=laquo;razdel=raquo;+laquo;raquo;laquo;raquo;+Edit1.Text+laquo;raquo;laquo;raquo;;.Filtered:=true;;
procedure TForm1.BitBtn1Click (Sender: TObject);
begin.Enabled:=true; .Enabled:=true; .Enabled:=true ;;
procedure TForm1.BitBtn6Click (Sender: TObject);
begin.Insert ;;
procedure TForm1.BitBtn8Click (Sender: TObject);
begin.Post ;;
procedure TForm1.BitBtn7Click (Sender: TObject);
beginMessageDlg ( Ви дійсно хочете видалити запис? , mtConfirmation, [mbOK, mbCancel], 0)=mrCancel then Abort; .Delete ;;.