此文档主要介绍了通过Spread组件模拟网页Excel效果,并可以实现一些简单的样式设置。
Match cellBackColor = reBackColor.Match(e.CommandName);
//设置边框颜色指令的标志
Regex reBorderColor = new Regex("BorderColor.");
Match cellBorderColor = reBorderColor.Match(e.CommandName);
//合并单元格指令的标志
Regex reCellCombin = new Regex("CellType.");
Match cellType = reCellCombin.Match(e.CommandName);
//增加行、列指令的标志
Regex reRowColumn = new Regex("addColumn.");
Match addRowColumn = reRowColumn.Match(e.CommandName);
//设置公式指令的标志
Regex reFormula = new Regex("formula.=");
Match setFormula = reFormula.Match(e.CommandName);
//设置单元格对齐方式的指令
Regex reCellSite = new Regex("SetCellSite.");
Match cellSite = reCellSite.Match(e.CommandName);
#endregion
#region 给指定的单元格设置公式
if (setFormula.Success)
{
//给指定的单元格设置公式
string strForm = e.CommandName.Substring(8);
if (strForm.Length > 1)
{
FarPoint.Web.Spread.Model.DefaultSheetDataModel dm = new
FarPoint.Web.Spread.Model.DefaultSheetDataModel();
FpSpreadText.ActiveSheetView.DataModel = dm;
dm.SetFormula(rowindex, columnindex, strForm);
}
}
#endregion
#region 导入Excel
if (e.CommandName == "InputExcel")
{
//导入Excel
// @"F:\\Test1.xlsx"为绝对路径
FpSpreadText.OpenExcel(@"F:\\Test1.xlsx");
FpSpreadText.ActiveSheetView.PageSize = FpSpreadText.Rows.Count+10;
//由于spread的边框粗细中的solid2对应Excel中的hairline,故需导入后,将Spread的边框尺寸设置为1,否则导入后边框会变成粗线。但是你如果没有执行添加区域单元格边框的那一步骤的话就没有必要执行这一步了,导出时同理。 int rowCount = FpSpreadText.Rows.Count;
int colCount = FpSpreadText.Columns.Count;
for (int i = 0; i < rowCount; i++)
{
FarPoint Spread控件使用_计算机软件及应用_IT/计算机_专业资料。FarPoint Spread WinForm交替背景色 grid1.BackColorStyle = 1 ret = grid1.SetOddEvenRowColor(...
//gcdn.grapecity.com Spread 产品介绍 13 2.2 基本功能介绍 Spread 支持导入和导出 Microsoft Excel 格式的文件,支持 PDF 导出,支持多工作表、跨工作表 公式...
Spread 基本知识(一) ---1 取得当前行号,列号.int row=e.Row; int count=e.Count; 或者: int rowindex = fpSpread1.ActiveSheet.ActiveRowIndex; int column...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
//gcdn.grapecity.com Spread 产品介终 13 2.2 基本功能介绍 Spread for ...单元格操作 3.1 设置单元格类型 Spread 5 for ASP.NET 支持 16 种单元格...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
通过设计器(Spread Designer)可以设置 Spread、Sheet、Selected Item 三种 对象的属性,以设计出所需的报表。使用方式是 将该控件拖到窗体中。 如果需要进行数据绑定...
Farpoint使用基础_计算机软件及应用_IT/计算机_专业资料。C#使用spread...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
FarPoint.Win.Spread.InputMap im; //spdResult是你画面中定义的spread的名字...["基本剂量"] = myItem.BaseDose.ToString(); row["剂量单位"] = myItem...
热门文档