
Aspose.Cells是一款功能强大的Excel文档处理和转来自换控件,开发人360百科员和客户电脑无需安装怕密讲龙许探买Microsoft Excel也能在应用程序中实现类似Excel的强大数据管理功能,支持所有Excel格式类型的操作,在没有Microsoft Excel的环境下,用户也可为其应用程序嵌入类似Excel的强大数据管理功能。Aspose.Cells可以对每一个具体企早样采精械价水队的数据,表格和格式进行管理,在各个层面导入图像,胜精存亚协设诉作委应用复杂的计算公式,并将应用程序中的表格保存为各种格式等。
- 中文名称 Aspose.Cells
- 软件类别 国外软件 / 表格类
- 软件语言 英文
- 目前最新版本 21.5
软件信息
软件类别:国外软件 / 表格类
软件语言:英文
平台:.NET, Java, C++, A来自ndroid, Node.js, PHP, Python, SharePoint, Reporting Services, Ja360百科sperReports
目前最新版本:21.5
委纪女盾办 更新日期:2020-05-15
公司简介
Aspose Pty Ltd 于2002年3月在澳大利亚悉尼创建。Aspose一直致力于成为全球最大的.Net 组件提供商,为全球.NET 程序员提供最丰富的选择。数十个国家的数千机构选择了Aspose的产品镇,这包括微软、IBM、普华永道、安永、杜邦、希尔顿酒店、读者文摘、美洲银行、波音、也且首严水酸制图关专西门子等等。
产品概述
Aspose.Cells是一个广受赞誉的电来自子表格组件,支持所有Excel格式类型的操作,用户无需依靠Microsoft Excel也可为其应城调内攻执用程序嵌入读写和处理Excel数据表座城支充格的功能。Aspose.Cells可以导入和导出每一个具体的数据,表格和格式,在各个层面导入图像,应用复杂的计算公式,并将Exce山乙农立众饭三洋气元l的数据保存为各种格式等360百科等---完成所有的这一切功能都无需使用Microsoft Excel 和Microsoft Office Automation。
常见用途
创建Excel仪表盘,结合图表和数据透视达德属肉策呀料件见表
高保真Exce该阻帝走l呈现和印刷
从Excel电子表格中导入数据
数据导林影背她大出到Excel电精该杂许主田子表格
电子表格操形许毛检式好大作/编辑
电子表格联兰顶伤转换
使用方式
1, 下载Aspose.Cells.dll 。在项目或者网站中添加引用Aspo利厂se.Cells.dll
板加汉建财威 Aspose.Cells(支持64位系统)
Aspose.Cells.支持64位系统。可专以很方便的操作Excel...在项目或者网站中添加引用 Aspose.Cells.dll
1, 下载As误pose.Cells.d团牛稳田衡ll 。在项目或者网站中添加引用Aspose.Cells.dll
选否程大世愿通妈穿 Code:
using System;
using System.D么段角该深ata;
using Sys教依零列县斗修掉tem.Configuration;
using System.Web;
using System.Web.Security;
using Syst力死em.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Aspose.Cells;
///
///AsposeExcel 的摘要说明
///
publicclassAsposeExcel
{
privatestring outFileName = "";
privatestring fullFilename = "";
privateWorkbook book = null;
privateWorksheet sheet = null;
publicAsposeExcel(string outfilename, string tempfilename)//导出构造数
{
outFileName = outfilename;
book = newWorkbook();
//book.Open(tempfilename);这里我们暂时不用模板
sheet = book.Worksheets[0];
}
publicAsposeExcel(string fullfilename)//导入构造数
{
fullFilename = fullfilename;
// book = newWorkbook();
//book.Open(tempfilename);
//sheet =book.Worksheets[0];
}
privatevoid AddTitle(stringtitle, int columnCount)
{
sheet.Cells.Merge(0, 0, 1,columnCount);
sheet.Cells.Merge(1, 0, 1,columnCount);
Cellcell1 = sheet.Cells[0, 0];
cell1.PutValue(title);
cell1.Style.HorizontalAlignment = TextAlignmentType.Center;
cell1.Style.Font.Name = "黑体";
cell1.Style.Font.Size = 14;
cell1.Style.Font.IsBold = true;
Cellcell2 = sheet.Cells[1, 0];
cell1.PutValue("查询时间:" + DateTime.Now.ToLocalTime());
cell2.SetStyle(cell1.Style);
}
privatevoid AddHeader(DataTabledt)
{
Cellcell = null;
for (int col = 0; col < dt.Columns.Count; col++)
{
cell = sheet.Cells[0, col];
cell.PutValue(dt.Columns[col].ColumnName);
cell.Style.Font.IsBold = true;
}
}
privatevoid AddBody(DataTabledt)
{
for (int r = 0; r < dt.Rows.Count; r++)
{
for(int c = 0; c < dt.Columns.Count; c++)
{
sheet.Cells[r + 1,c].PutValue(dt.Rows[r][c].ToString());
}
}
}
//导出------------下一篇会用到这个方法
publicBoolean DatatableToExcel(DataTabledt)
{
Booleanyn = false;
try
{
//sheet.Name= sheetName;
//AddTitle(title,dt.Columns.Count);
//AddHeader(dt);
AddBody(dt);
sheet.AutoFitColumns();
//sheet.AutoFitRows();
book.Save(outFileName);
yn = true;
returnyn;
}
catch (Exception e)
{
returnyn;
// throwe;
}
}
publicDataTable ExcelToDatatable()//导入
{
Workbookbook = newWorkbook();
book.Open(fullFilename);
Worksheetsheet = book.Worksheets[0];
Cellscells = sheet.Cells;
//获取excel中的数据保存到一个datatable中
DataTabledt_Import = cells.ExportDataTableAsString(0, 0, cells.MaxDataRow + 1,cells.MaxDataColumn + 1, false);
// dt_Import.
returndt_Import;
}
}
Suport:760420057,即日起程
评论留言