通过导入导出xml的方式复制
- private void button1_Click(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.SheetView s = new FarPoint.Win.Spread.SheetView();
- s.Cells[0, 0].Text = "test";
- FarPoint.Win.Spread.DrawingSpace.FourWayArrowShape sh = new FarPoint.Win.Spread.DrawingSpace.FourWayArrowShape();
- sh.Name = "Arrow";
- s.AddShape(sh);
- fpSpread1.Sheets.Add(CopySheet(s));
- }
- public FarPoint.Win.Spread.SheetView CopySheet(FarPoint.Win.Spread.SheetView sheet)
- {
- FarPoint.Win.Spread.SheetView newSheet = null;
- if (sheet != null)
- {
- newSheet = (FarPoint.Win.Spread.SheetView)FarPoint.Win.Serializer.LoadObjectXml(typeof(FarPoint.Win.Spread.SheetView), FarPoint.Win.Serializer.GetObjectXml(sheet, "CopySheet"), "CopySheet");
- }
- return newSheet;
- }
复制代码 |