婧友 你好,
可以在数据不完整出现前一行设置 PageBreak 为 True,从而避免该情况,测试代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- this.FpSpread1.ClientAutoSize = true;
- this.FpSpread1.Sheets[0].PageSize = 60;
- this.FpSpread1.Sheets[0].RowCount = 60;
- for (int i = 0; i < this.FpSpread1.Sheets[0].RowCount; i++)
- {
- for (int j = 0; j < this.FpSpread1.Sheets[0].ColumnCount; j++)
- {
- this.FpSpread1.Sheets[0].Cells[i, j].Text = "测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试";
- }
- }
- }
- protected void FpSpread1_PrintSheet(object sender, FarPoint.Web.Spread.PrintEventArgs e)
- {
- if (e.Row==5)
- {
- e.PageBreak = true;
- }
- }
复制代码 |