FarPoint.Web.Spread.NamedStyle backstyle = new FarPoint.Web.Spread.NamedStyle(“BlueBack”);
backstyle.BackColor = Color.Blue;
FarPoint.Web.Spread.NamedStyle text1style = new FarPoint.Web.Spread.NamedStyle(“OrangeText”, “BlueBack”);
text1style.ForeColor = Color.Orange;
FarPoint.Web.Spread.NamedStyle text2style = new FarPoint.Web.Spread.NamedStyle(“YellowText”, “BlueBack”);
text2style.ForeColor = Color.Yellow;
FpSpread1.NamedStyles.Add(backstyle);
FpSpread1.NamedStyles.Add(text1style);
FpSpread1.NamedStyles.Add(text2style);
FpSpread1.ActiveSheetView.Cells[0,0,2,0].StyleName = “OrangeText”;
FpSpread1.ActiveSheetView.Cells[0,1,2,1].StyleName = “YellowText”;
使用css
FarPoint.Web.Spread.GeneralCellType mycelltype = new FarPoint.Web.Spread.GeneralCellType();
myCellType.CssClass = “myCssClass”;
FpSpread1.ColumnHeader.Cells[0, 0].CellType = myCellType;
FpSpread1.Cells[0, 1].CellType = myCellType;
创建一个区域
FarPoint.Web.Spread.Cell range1;
range1 = fpSpread1.ActiveSheetView.Cells[1, 1, 3, 3];
range1.Value = “Value Here”;
range1.Note = “This is the note that describes the value.”;
添加合并单元
FpSpread1.ActiveSheetView.Cells[1,1].Text = “These six cells are spanned.”;
FpSpread1.ActiveSheetView.Cells[2,2].Text = “This is text in 2,2.”;
FpSpread1.ActiveSheetView.AddSpanCell(1, 1, 2, 3);
自动合并相同行列
FpSpread1.Sheets[0].SetRowMerge(-1, FarPoint.Web.Spread.Model.MergePolicy.Always);
FpSpread1.Sheets[0].SetColumnMerge(-1, FarPoint.Web.Spread.Model.MergePolicy.Always);
设置滚动条
FpSpread1.HorizontalScrollBarPolicy = ScrollBarPolicy.Always;
FpSpread1.VerticalScrollBarPolicy = ScrollBarPolicy.AsNeeded;
设置滚动条的颜色
FpSpread1.ScrollBar3DLightColor = Color.Yellow;
FpSpread1.ScrollBarArrowColor = Color.Green;
FpSpread1.ScrollBarBaseColor = Color.Brown;
FpSpread1.ScrollBarDarkShadowColor = Color.Purple;
FpSpread1.ScrollBarFaceColor = Color.Orange;
FpSpread1.ScrollBarHighlightColor = Color.White;
FpSpread1.ScrollBarShadowColor = Color.Blue;
FpSpread1.ScrollBarTrackColor = Color.Pink;
FpSpread1.Sheets[0].AllowLoadOnDemand = True;
FpSpread1.Sheets(0).PageSize = 40
FpSpread1.Sheets[0].LoadInitRowCount = 10;
long i;
for (i = 1; i <= 20; i++)
{
FpSpread1.Sheets[0].Cells[i, 0].Value = i;
}
TabKey
FpSpread1.ProcessTab = false;
定义tab的样式
FpSpread1.Sheets.Count = 3;
FarPoint.Web.Spread.TabInfo().TabControlPolicy = FarPoint.Web.Spread.TabControlPolicy.Always;
FpSpread1.Tab.VisibleCount = 2;
FpSpread1.Tab.ScrollIncrement = 2;
FpSpread1.Tab.FirstVisibleTab = 1;
FpSpread1.Tab.TextColor = Color.Yellow;
FpSpread1.Tab.ActiveTabBackColor = Color.Green;
FpSpread1.Tab[0] = “First”;
FpSpread1.Tab[1] = “Second”;
FpSpread1.Tab[2] = “Third”;
切换工作表是否ajax支持
FpSpread1.EnableAjaxCall = true;
FpSpread1.ClientAutoCalculation = true;
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/216851.html原文链接:https://javaforall.net
