请参考如下代码:
- private void button1_Click(object sender, EventArgs e)
- {
- fpSpread2.ActiveSheet.Save("temp.xml",false);
- var newSheet = new FarPoint.Win.Spread.SheetView();
- newSheet.Open("temp.xml");
- newSheet.SheetName = "NewSheet";
- fpSpread1.Sheets.Add(newSheet);
- fpSpread1.Sheets[1].AddSelection(0, 0, newSheet.RowCount, newSheet.ColumnCount);
- fpSpread1.Sheets[1].ClipboardCopy(fpSpread1.Sheets[1].GetSelection(0));
- fpSpread1.Sheets[0].AddRows(fpSpread1.Sheets[0].RowCount, fpSpread1.Sheets[1].RowCount);
- fpSpread1.Sheets[0].SetActiveCell(fpSpread1.Sheets[0].RowCount - fpSpread1.Sheets[1].RowCount, 0);
- fpSpread1.ActiveSheet.ClipboardPaste(ClipboardPasteOptions.All);
复制代码 |