我想打印包含清单的表格中的收据,其中有2张钞票在" A4"纸张。当两张纸币打印在一张纸上,如果核对清单检查的项目大于2,则必须添加新纸币。我从几个小时尝试它并尝试使用e.HasMorePages打印多个页面。现在,当我点击打印时,第二页与第一页重叠。我在3小时前搜索了一些例子,但遗憾的是它不起作用
请帮忙。
private void print(System.Drawing.Printing.PrintPageEventArgs e)
{
if (ChkListConnectedTap.CheckedItems.Count > 0)
{
flagFor = true;
for (int i = 0; i < ChkListConnectedTap.CheckedItems.Count; i++)
{
customerNumSelected = global.ObjDboperation.InEnglish(ChkListConnectedTap.Items[i].ToString());
loadYearmonths1(customerNumSelected);
Initialize(customerNumSelected);
//plotting coordinates
yPos = 5 + count * 540;
InitPt = new Point(50, Convert.ToInt32(yPos));
LeftSideMeterReader(e);
RightSideMeterReader(e);
//check wheter the plotted coodinated greater than maximum height of page.
if (AddMorePages(e, yPos, count) && pages <= (Convert.ToInt32(ChkListConnectedTap.CheckedItems.Count / 2) + 1))
{
e.HasMorePages = true;
count = 0;
pages++;
continue;
}
else
{
e.HasMorePages = false;
}
count++;
}
}
else
{
MessageBox.Show("सुरुमा ग्राहक संख्या छान्नुहोस् !", global.msgCaptionHead, MessageBoxButtons.OK);
return;
}
}
private bool AddMorePages(System.Drawing.Printing.PrintPageEventArgs e,float PosY,int cnt) {
if (PosY + 560 >= 1100)
{
return true;
}
else {
return false;
}
}