谢谢~~这部分内容没有帮助~~苦啊

解决方案 »

  1.   

    找一个SMExport之类的第三方控件最简单。
      

  2.   

    我用过一个控件,可以吧查询到的结果(显示用的是dbgrid),输出到自己定义名字的excel中,比较实用,是在csdn上下的,叫:10947_lanrpt,就是LANREPORT
      

  3.   

    有个控件叫 xls什么的.你可以看看
      

  4.   

    to jxc163(一水寒)  是什么控件?能否说一下大致用哪几个函数或过程?
      

  5.   

    form中放三个控件ExcelApplication1、excelworkbook1、excelworksheet1
      ExcelApplication1.Connect;
      ExcelApplication1.Visible[0]:=true;
      ExcelApplication1.Workbooks.Add('',0);
      excelworkbook1.ConnectTo(ExcelApplication1.Workbooks[1]);
      excelworksheet1.ConnectTo(excelworkbook1.Worksheets[1] as _worksheet);
      

  6.   

    我希望有没有能像StringGrid那样可以每个cell自己写内容的,然后一次输出。
    因为里面的数据不是从数据库里直接导出来,需要一些计算和转换。
      

  7.   

    教你个最简单的方法:
    var
      tmp_lst:TStringList;
      tp_str:String;
      i,j:Integer;
    begin
      tmp_lst:=TStringList.Create;
      DataSet.First;
      for  i:=0  to DataSet.RecordCount  do
      begin
        tp_str:='';
        for j:=0  to DataSet.FieldCount do
        begin
          tp_str:=tp_str+DataSet.Fields[0].AsString+#9;
        end;
       tmp_lst.Add(tp_str);
      end;
    end;
      

  8.   

    var
      tmp_lst:TStringList;
      tp_str:String;
      i,j:Integer;
    begin
      tmp_lst:=TStringList.Create;
      DataSet.First;
      for  i:=0  to DataSet.RecordCount  do
      begin
        tp_str:='';
        for j:=0  to DataSet.FieldCount do
        begin
          tp_str:=tp_str+DataSet.Fields[0].AsString+#9;
        end;
       tmp_lst.Add(tp_str);
      end;
      tmp_lst.SaveToFile('C:\A.XLS');
      

  9.   

    to chenxi_aji(阿吉):最近出差了,没看到你的帖子,单元格的值可用下面的方面来赋值.
      excelworksheet1.Cells.Item[行,列]:=数值;