Java导出Excel和CSV的简单实现,分别使用POI和JavaCSV. JavaBean public class ReportInfo { int id; String date; int num; int percent; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDate() { return date; } public void set…
注:要添加COM组件 Microsoft Excel 11.0 Object Library 引用. 具体代码如下: using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; using Excel; using System.Reflection; using System.Data; using System.Data.OleDb; namespace Re…