给我一个将表(.db)转化成excel格式的例子,包含设置字体和表头:
在这里很多帖子都提到了这个,搜索以下吧

解决方案 »

  1.   

    转帖
    uses ComObj
    procedure Tfrom1.button1.click(sender:object);
     var
      myexcel:variant;
      workbook:olevariant;
      worksheet:olevariant;
      i,j:integer;
     begin
      try
       myexcel:=createoleobject('excel.application');
       myexcel.application.wordbooks.add;
       myexcel.caption:='将数据导入到EXCEL表中';
       myexcel.application.visible:=true;
       workbook:=myexcelobject1.application.workbooks[1];
       wordsheet:=wordbook.wordsheets.item[1];
       except
        showmessage('EXCEL不存在!');
       end;
       i:=0;
      table1.first;
      while not table1.eof do
       begin
        inc(i);
        for j:=0 to table1.fieldcount-1 do
          wordsheet.cells[i,j+1]:=table1.fields[j].asstring;
        table1.next; 
       end;
       end;
      

  2.   

    找XL Report G2 构件吧,这这个问题对它来说简直就是小儿科。