http://topic.csdn.net/u/20080603/11/a9d32f01-50ec-4377-881c-75e58be72194.html
这个是java代码实现,把数据写入excel表的,我不想把代码再帖一遍了,对你或许有帮助。

解决方案 »

  1.   

    引入POI包,或JXL包这两个都可以完成对于EXCEL等的操作.
      

  2.   

    一个jacob操作Word的例子,其他操作excel的sample里都有 
    出处 http://www.blogjava.net/fanyingjie/archive/2008/03/05/183942.html
    import java.io.File;
      import com.jacob.com.*;
      import com.jacob.activeX.*;
      public class WordTest {
      
       public static void main(String[] args) {
         WordBean word=new WordBean();
         word.openWord(true);
         word.createNewDocument();
         word.insertText("Hello word.");
       }
      }  import com.jacob.activeX.*;
      import com.jacob.com.*;
      public class WordBean extends java.awt.Panel
      {
       private ActiveXComponent MsWordApp = null;
       private Dispatch document = null;
       public WordBean()
       {
         super();
       }
       public void openWord(boolean makeVisible)
       {
      //Open Word if we've not done it already
         if (MsWordApp == null)
         {
           MsWordApp = new ActiveXComponent("Word.Application");
         }
      //Set the visible property as required.
         Dispatch.put(MsWordApp, "Visible",
                new Variant(makeVisible));
       }
       public void createNewDocument()
       {
      //Find the Documents collection object maintained by Word
         Dispatch documents =
             Dispatch.get(MsWordApp,"Documents").toDispatch();
      //Call the Add method of the Documents collection to create
      //a new document to edit
         document = Dispatch.call(documents,"Add").toDispatch();
       }
       public void insertText(String textToInsert)
       {
      // Get the current selection within Word at the moment. If
      // a new document has just been created then this will be at
      // the top of the new doc
         Dispatch selection =
             Dispatch.get(MsWordApp,"Selection").toDispatch();
      //Put the specified text at the insertion point
         Dispatch.put(selection,"Text",textToInsert);
       }
       public void saveFileAs(String filename)
       {
         Dispatch.call(document,"SaveAs",filename);
       }
       public void printFile()
       {
      //Just print the current document to the default printer
         Dispatch.call(document,"PrintOut");
       }
       public void closeDocument()
       {
      // Close the document without saving changes
      // 0 = wdDoNotSaveChanges
      // -1 = wdSaveChanges
      // -2 = wdPromptToSaveChanges
         Dispatch.call(document, "Close", new Variant(0));
         document = null;
       }
       public void closeWord()
       {
         Dispatch.call(MsWordApp,"Quit");
         MsWordApp = null;
         document = null;
       }
      } 
      

  3.   

    POI操作excel很不错 参照这个 http://ltc603.javaeye.com/blog/30040
      

  4.   

    apache下载poi包或是你将其保存为csv的格式 是每行对应一行  字段用逗号隔开的 
      

  5.   

    JXL对EXCEL操作很简便,感觉容易上手,他本身好像也是全JAVA写的,但好像没有POI功能那么强,但比POI好用,(一年前的事了)
      

  6.   

    jxl poi
    网上的例子真的很多
    http://hi.baidu.com/oracle11g/blog/item/a6ea2ffa7425371ea9d311ea.htmlhttp://blog.csdn.net/damnhe/archive/2006/01/11/576529.aspx