home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / Chip_2003-01_cd1.bin / zkuste / delphi / kolekce / d567 / FLEXCEL.ZIP / Demo / GetStated / UGetStarted.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2002-09-26  |  1.4 KB  |  59 lines

  1. unit UGetStarted;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, UFlexcelReport, UExcelAdapter, XLSAdapter, Db, DBTables,
  8.   UCustomFlexCelReport, UWaitCursor;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Cust: TTable;
  13.     CustCustNo: TFloatField;
  14.     CustCompany: TStringField;
  15.     CustPhone: TStringField;
  16.     CustLastInvoiceDate: TDateTimeField;
  17.     CustAddr1: TStringField;
  18.     CustAddr2: TStringField;
  19.     CustCity: TStringField;
  20.     CustState: TStringField;
  21.     CustZip: TStringField;
  22.     CustCountry: TStringField;
  23.     CustFAX: TStringField;
  24.     CustTaxRate: TFloatField;
  25.     CustContact: TStringField;
  26.     CustTotAddr1: TStringField;
  27.     CustTotAddr2: TStringField;
  28.     XLSAdapter: TXLSAdapter;
  29.     RepStart: TFlexCelReport;
  30.     Button1: TButton;
  31.     Memo1: TMemo;
  32.     SaveDialog1: TSaveDialog;
  33.     procedure Button1Click(Sender: TObject);
  34.   private
  35.     { Private declarations }
  36.   public
  37.     { Public declarations }
  38.   end;
  39.  
  40. var
  41.   Form1: TForm1;
  42.  
  43. implementation
  44.  
  45. {$R *.DFM}
  46.  
  47. procedure TForm1.Button1Click(Sender: TObject);
  48. var
  49.   WaitCursor: IWaitCursor;
  50. begin
  51.   if not SaveDialog1.Execute then exit;
  52.   if FileExists(SaveDialog1.FileName) then DeleteFile(SaveDialog1.FileName);
  53.   RepStart.FileName:=SaveDialog1.FileName;
  54.   WaitCursor:=TWaitCursor.Create;
  55.   RepStart.Run;
  56. end;
  57.  
  58. end.
  59.