数据用excel的形式显示

解决方案 »

  1.   

    先用TTable连上数据表,再把记录一条条的往Excel里写就是了
      

  2.   

    我为你写的,这里可以写到excel中:你看够不够详细?
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, comobj;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        v: variant;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      v := CreateOleObject('Excel.Application');
      v.visible := True;
    end;end.