Example #1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //Check if there is at least one rincian

            //Check nota sequence

            //Check nilai surat jalan vs nilai uang setoran

            //Others info connected to this transaction
            //Print Selected Transaction
            //Print
            DialogResult res = MessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptLaporanPenj rpt = new rptLaporanPenj();
                rpt.ReportParameters["user"].Value     = NBConfig.ValidUserName;
                rpt.ReportParameters["lappenid"].Value = lappenid_;
                //rpt.ReportParameters["custtypetoid"].Value = custtypetoid;

                IReportDocument iRpt = (IReportDocument)rpt;
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = iRpt;

                    reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);
                    using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                    {
                        tbl.UpdateLapPenj(NBConfig.ValidUserName
                                          , 1
                                          , 1
                                          , int.Parse(lappenid_));
                    }
                    SetFormPrinted();
                }
                catch (Exception ex)
                {
                    helper.ErrorMessage(ex.Message);
                }
            }
        }
Example #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string iLappenID = radGridView3.SelectedRows[0].Cells["lappenID"].Value.ToString();
            //Print
            DialogResult res = RadMessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button2);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptLaporanUJ rpt = new rptLaporanUJ();
                rpt.ReportParameters["user"].Value     = NBConfig.ValidUserName;
                rpt.ReportParameters["lappenid"].Value = iLappenID;
                rpt.ReportParameters["logid"].Value    = radGridView3.SelectedRows[0].Cells["logID"].Value.ToString();

                IReportDocument iRpt = (IReportDocument)rpt;

                iRpt.DocumentName = radGridView3.SelectedRows[0].Cells["NOSJ"].Value.ToString() + " "
                                    + radGridView3.SelectedRows[0].Cells["SalesName"].Value.ToString();
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                try
                {
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = iRpt;

                    reportProcessor = new ReportProcessor();

                    reportProcessor.PrintReport(reportSource, printerSettings);
                    using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                    {
                        tbl.UpdateLapPenj(NBConfig.ValidUserName
                                          , 1
                                          , 1, int.Parse(iLappenID));
                    }
                    helper.PrintLog(this.GetType().Name, rpt.Name, "Print:" + iLappenID);
                    this.vlappenTableAdapter.FillByTanggal(this.sinarekDataSet.vlappen, dtpTanggalLaporan.Value, "UJ");
                }
                catch (Exception ex)
                {
                    helper.SysLog(this.GetType().Name, this.Text, ex.Message);
                    //helper.ErrorMessage(ex.Message);
                }
            }
        }