private static int RecordCount = 0;
private void detail_Format(object sender, EventArgs e)
{
RecordCount += 1;
if (RecordCount % 12 != 0)
{
this.detail.NewPage = NewPage.None;
}
else
{
this.detail.NewPage = NewPage.After;
RecordCount = 0;
}
}
private void Rpt_PageEnd(object sender, EventArgs e)
{
RecordCount = 0;
}
这个方法有点问题 修改后为:
private int RecordCount = 0;
private readonly int ONE_PAGE_MAX_RECORD_COUNT = 13;
private void detail_Format(object sender, EventArgs e)
{
RecordCount += 1;
if (RecordCount % (ONE_PAGE_MAX_RECORD_COUNT + 1) != 0)
{
this.detail.NewPage = NewPage.None;
}
else
{
this.detail.NewPage = NewPage.Before;
}
}
private void RptTradeStatement_PageEnd(object sender, EventArgs e)
{
if (RecordCount > ONE_PAGE_MAX_RECORD_COUNT)
{
RecordCount = 1;
}
else
{
RecordCount = 0;
}
}