一个.Net强大的Excel控件,支持WinForm、WPF、Android【强烈推荐】
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
推荐一个强大的电子表单控件:unvell.ReoGrid.dll,使用简单且功能强大。 项目简介 控件核心功能 下面以WinForm举例 1、安装控件 PM> Install-Package unvell.ReoGrid.dll 2、拖拉控件 3、向填充单元格文本 var worksheet = reoGridControl1.CurrentWorksheet; worksheet.Cells["A1"].Data = "Hello World!"; worksheet.Cells["A1"].Style.TextColor = Color.Red; 效果 4、汇总折线图 var worksheet = reoGridControl1.CurrentWorksheet; worksheet["A2"] = new object[,] { { null, 2008, 2009, 2010, 2011, 2012 }, { "City 1", 3, 2, 4, 2, 6 }, { "City 2", 7, 5, 3, 6, 4 }, { "City 3", 13, 10, 9, 10, 9 }, { "Total", "=SUM(B3:B5)", "=SUM(C3:C5)", "=SUM(D3:D5)", "=SUM(E3:E5)", "=SUM(F3:F5)" }, }; var dataRange = worksheet.Ranges["B3:F5"]; var serialNamesRange = worksheet.Ranges["A3:A6"]; var categoryNamesRange = worksheet.Ranges["B2:F2"]; worksheet.AddHighlightRange(categoryNamesRange); worksheet.AddHighlightRange(serialNamesRange); worksheet.AddHighlightRange(dataRange); var c1 = new LineChart { Location = new unvell.ReoGrid.Graphics.Point(500, 50), Size = new Size(400, 260), Title = "折线图示例", DataSource = new WorksheetChartDataSource(worksheet, serialNamesRange, dataRange) { CategoryNameRange = categoryNamesRange, } }; worksheet.FloatingObjects.Add(c1); 效果 https://github.com/unvell/ReoGrid 该文章在 2023/9/28 11:18:48 编辑过 |
关键字查询
相关文章
正在查询... |