private void Btn_PrintDesgin_Click(object sender, EventArgs e) { #region 打印设计 if (GirdCard.GetSelectedRows().Length < 1) { throw new Exception("没有选择数据!"); } List <string> list = new List <string>(); foreach (int index in GirdCard.GetSelectedRows()) { list.Add(GirdCard.GetRowCellValue(index, "CardNo").ToString()); } DataTable dtMain = dal.GetHead(list.ToArray()); DataTable dtDetail = dal.GetBody(list.ToArray()); string path = Application.StartupPath.Trim('\\'); this.report1.Load(path + "\\ReportPrint\\产品跟踪卡.frx"); this.report1.RegisterData(dtMain, "M"); this.report1.RegisterData(dtDetail, "D"); this.report1.GetDataSource("M").Enabled = true; this.report1.GetDataSource("D").Enabled = true; this.report1.Design(); #endregion }
private void BtnPrint_Click(object sender, EventArgs e) { #region 打印 if (string.IsNullOrEmpty(cardNo)) { throw new Exception("未生成流转卡!"); } MCardDAL mdal = new MCardDAL(); DataTable dtMain = mdal.GetHead(cardNo); DataTable dtDetail = mdal.GetBody(cardNo); string path = Application.StartupPath.Trim('\\'); this.report1.Load(path + "\\ReportPrint\\产品跟踪卡.frx"); this.report1.RegisterData(dtMain, "M"); this.report1.RegisterData(dtDetail, "D"); this.report1.GetDataSource("M").Enabled = true; this.report1.GetDataSource("D").Enabled = true; this.report1.Show(); #endregion }
private void BtnPrint_Click(object sender, EventArgs e) { #region 打印 if (string.IsNullOrEmpty(cardNo)) { throw new Exception("未生成流转卡!"); } MCardDAL mdal = new MCardDAL(); DataTable dtMain = mdal.GetHead(cardNo); DataTable dtDetail = mdal.GetBody(cardNo); string path = ".\\ReportPrint\\产品跟踪卡.frx"; var rep = FReportHelper.GetReport(path, dtMain, dtDetail); rep.Show(); #endregion }