资源介绍
里面有个文本文件介绍怎么操作 导入dll文件,具体工具箱中 选择项 添加
ExcelFile excelFile = new ExcelFile();
ExcelWorksheet sheet = excelFile.Worksheets.Add("WolfSpider");
int columns = dataGridView1.Columns.Count;
int rows = dataGridView1.Rows.Count;
for (int j = 0; j < columns;j++ )
{
sheet.Cells[0, j].Value = dataGridView1.Columns[j].HeaderText;
}
for (int i = 1; i <= rows; i++)
{
for (int j = 0; j < columns; j++)
{
sheet.Cells[i, j].Value = dataGridView1[j, i-1].Value;
}
}
excelFile.SaveXls("./WolfSpider.xls");//保存位置
ExcelFile excelFile = new ExcelFile();
ExcelWorksheet sheet = excelFile.Worksheets.Add("WolfSpider");
int columns = dataGridView1.Columns.Count;
int rows = dataGridView1.Rows.Count;
for (int j = 0; j < columns;j++ )
{
sheet.Cells[0, j].Value = dataGridView1.Columns[j].HeaderText;
}
for (int i = 1; i <= rows; i++)
{
for (int j = 0; j < columns; j++)
{
sheet.Cells[i, j].Value = dataGridView1[j, i-1].Value;
}
}
excelFile.SaveXls("./WolfSpider.xls");//保存位置
- 上一篇: 迷你PDG阅读器 绿色无限制版
- 下一篇: Winform 实现Word/Excel转换为PDF文件