分列打印显示

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

//打印
public override void barItemPrint_ItemClick(object sender, ItemClickEventArgs e)
{
if (this.gv.SelectedRowsCount == 0)
{
MessageBox.Show("请选择要打印信息!");
return;
}
try
{
gv.PostEditor();
SpsSequence spsSequence = this.gv.GetRow(this.gv.GetSelectedRows()[0]) as SpsSequence;

List rptlist = spsSequenceService.selectList(spsSequence);
if (rptlist.Count>0)
{

int a = 0;
if (rptlist.Count % 2 == 0)
{
a = rptlist.Count / 2;
}
else
{
a = rptlist.Count / 2 + 1;
}
/// int ps = 22;
// int p = a / ps;
int j = 0;
for (int i = a; i < rptlist.Count; i++)
{
rptlist[j].Rowno1 = a + j + 1 + "";
rptlist[j].Cpcode1 = rptlist[i].Cpcode;
rptlist[j].Mttext1 = rptlist[i].Mttext;
rptlist[j].Cpqty1 = rptlist[i].Cpqty;
rptlist[j].Spcode1 = rptlist[i].Spcode;
rptlist[j].Brevitycode1 = rptlist[i].Brevitycode;

j++;
rptlist.RemoveAt(i);
i--;
}
/* for (int k = 0; k < rptlist.Count; k++)
{
int m = k / ps;
m = m == 0 ? (k + 1) : k;
rptlist[k].Rowno = (k / ps + 1) * m + "";
if (a != 0 && k == rptlist.Count -1)
{
}
else
{
int currno = int.Parse(rptlist[k].Rowno);
rptlist[k].Rowno1 = currno + ps + "";
}
}

*/
spsSequenceService.updateprint(spsSequence);
// SSInfoReportForm form = new SSInfoReportForm();
// form.Datasource = rptlist;
// form.Show();
XtraReport xreport = XtraReport.FromFile(Application.StartupPath + "\\rpt\\" + "MM_SpsPrint.repx", true);
xreport.PrintingSystem.ShowMarginsWarning = false;
xreport.DataSource = rptlist;
xreport.Print();
//xreport.PrinterName = 打印机名称;

}
else
{
MessageBox.Show("此数据在工位区间内没有物料信息!");
}
}
catch (Exception e1)
{
MessageBox.

Show(e1.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

相关文档
最新文档