一個(gè).Net強(qiáng)大的Excel控件,支持WinForm、WPF、Android【強(qiáng)烈推薦】
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
推薦一個(gè)強(qiáng)大的電子表單控件:unvell.ReoGrid.dll,使用簡(jiǎn)單且功能強(qiáng)大。 項(xiàng)目簡(jiǎn)介 控件核心功能 下面以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 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |