this.FpSpread1.Sheets.Clear();
this.FpSpread1.ClientAutoCalculation = true;
FpSpread fp = new FpSpread();
fp.Open(fpXml);
fp.ActiveSheetView.SheetName = "xx确认";
fp.ActiveSheetView.AutoCalculation = true;
SetFarpoint(fp);
this.FpSpread1.Sheets.Add(fp.ActiveSheetView);
this.FpSpread1.Sheets[0].SetColumnMerge(1, MergePolicy.Always);
this.FpSpread1.Sheets[0].SetColumnMerge(2, MergePolicy.Always);
SetFarpointColumn();
public void SetFarpoint(FpSpread fp)
{
fp.ActiveSheetView.ColumnHeader.Cells[0, 1].CellType = ctCategory;
fp.ActiveSheetView.ColumnHeader.Columns[1].CellType = ctCategory;
}
public void SetFarpointColumn()
{
this.FpSpread1.Sheets[0].ColumnCount = 5;
this.FpSpread1.Sheets[0].Columns[0].DataField = "XH";
FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].CellType = ctCategory;
this.FpSpread1.Sheets[0].Columns[1].CellType = ctCategory;
//FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Value=
//this.FpSpread1.Sheets[0].Columns[1].DataField = "JH";
this.FpSpread1.Sheets[0].Columns[2].DataField = "JH";
this.FpSpread1.Sheets[0].Columns[3].DataField = "QRJM";
this.FpSpread1.Sheets[0].Columns[4].DataField = "xxly";
for (int i = 0; i < FpSpread1.Sheets[0].ColumnCount; i++)
{
this.FpSpread1.Sheets[0].Columns.VerticalAlign = VerticalAlign.Middle;
this.FpSpread1.Sheets[0].Columns.HorizontalAlign = HorizontalAlign.Center;
this.FpSpread1.Sheets[0].Columns.Border = new Border(BorderStyle.Solid, Color.Black);
}
// this.FpSpread1.Sheets[sheetIndex].FrozenColumnCount = 4;
}
显示效果如下:
|
|