예제 #1
0
        private void PrintProductCard_A4(List <T_ARRIVAL_DTL> jobOrdNo, string prodSEQNo, List <MaterialCard> lstPrdCard)
        {
            int printSeq = 0;

            try
            {
                base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

                DataSet ds;

                using (ArrivalBLL jobOrdBll = new ArrivalBLL())
                {
                    ds = jobOrdBll.PrintProductCardReport(jobOrdNo, prodSEQNo, lstPrdCard, this.USER_ID, out printSeq);
                }

                ReportViewer viewer = new ReportViewer();
                viewer.AutoCloseAfterPrint = true;


                //RPT_PRODUCT_CARD rpt = new RPT_PRODUCT_CARD();
                XtraReport rpt    = null;
                string     fixRpt = HTN.BITS.UIL.PLASESS.Properties.Settings.Default.FixProductCardReport;//UiUtility.FixProductCardReport;
                if (string.IsNullOrEmpty(fixRpt))
                {
                    //rpt = new RPT_MATERIAL_CARD();
                }
                else
                {
                    rpt = UiUtility.GetReportByName(fixRpt);
                }

                if (rpt != null)
                {
                    rpt.DataSource = ds;
                    rpt.Parameters["paramUserPrint"].Value       = this.USER_ID;
                    rpt.Parameters["paramPRODUCTION_TYPE"].Value = this.MTL_TYPE;
                    rpt.CreateDocument();

                    viewer.SetReport(rpt);
                    viewer.LogPrintTime(printSeq);

                    base.FinishedProcessing();

                    viewer.ShowDialog();
                }
                else
                {
                    XtraMessageBox.Show("Report is null");
                }
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }