您好,
我们尝试通过以下步骤重现,但是,没有发现您所描述的问题。您看下,我是不是漏掉了哪个步骤?
1.初始化
- fpSpread1.ActiveSheet.SetValue(0, 0, "S");
- fpSpread1.ActiveSheet.SetValue(0, 1, "E");
- fpSpread1.ActiveSheet.SetValue(0, 2, "A");
- fpSpread1.ActiveSheet.SetValue(0, 3, "K");
- fpSpread1.ActiveSheet.SetValue(1, 0, "W");
- fpSpread1.ActiveSheet.SetValue(1, 1, "G");
- fpSpread1.ActiveSheet.SetValue(1, 2, "P");
- fpSpread1.ActiveSheet.SetValue(1, 3, "V");
- fpSpread1.ActiveSheet.SetValue(2, 0, "O");
- fpSpread1.ActiveSheet.SetValue(2, 1, "L");
- fpSpread1.ActiveSheet.SetValue(2, 2, "Q");
- fpSpread1.ActiveSheet.SetValue(2, 3, "H");
复制代码
2.排序
- private void button1_Click(object sender, EventArgs e)
- {
- fpSpread1.ActiveSheet.SortRows(1, false, true, System.Collections.Comparer.Default);
- }
复制代码
3.打印
- private void button2_Click(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
- printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange;
- //printset.ColStart = 1;
- //printset.ColEnd = 1;
- printset.RowStart = 1;
- printset.RowEnd = 1;
- // Set the PrintInfo property for the first sheet.
- fpSpread1.Sheets[0].PrintInfo = printset;
- // Print the sheet.
- fpSpread1.PrintSheet(0);
- }
复制代码
结果:
|