예제 #1
0
        public void load_report()
        {
            var ds = new Dataset.yakkumdbTableAdapters.data_pasienTableAdapter();

            ds.ClearBeforeFill = true;
            ds.Fill(yakkumdb.data_pasien, _noresep);
            var ds2 = new Dataset.yakkumdbTableAdapters.data_resepTableAdapter();

            ds2.ClearBeforeFill = true;
            ds2.Fill(yakkumdb.data_resep, _noresep);

            //this.rvResep.ZoomMode = ZoomMode.PageWidth;
            //this.rvResep.RefreshReport();
            DataTable dt = ds.GetData(_noresep);

            foreach (DataRow r in dt.Rows)
            {
                _sep = r["vc_no_sep"].ToString();
                //MessageBox.Show(_sep);
            }

            if (InvokeRequired)
            {
                // after we've done all the processing,
                this.Invoke(new MethodInvoker(delegate
                {
                    // load the control with the appropriate data'
                    this.rvResep.ZoomMode = ZoomMode.PageWidth;
                    this.rvResep.RefreshReport();
                }));
                return;
            }
        }
예제 #2
0
        private void btPrint_Click(object sender, EventArgs e)
        {
            var ds = new Dataset.yakkumdbTableAdapters.data_pasienTableAdapter();

            ds.ClearBeforeFill = true;
            ds.Fill(yakkumdb.data_pasien, _noresep);
            var ds2 = new Dataset.yakkumdbTableAdapters.data_resepTableAdapter();

            ds2.ClearBeforeFill = true;
            ds2.Fill(yakkumdb.data_resep, _noresep);

            //this.rvResep.LocalReport.DataSources.Clear();

            ReportDataSource _rds = new ReportDataSource();

            _rds.Name  = "dsPasien";
            _rds.Value = ds.GetData(_noresep);
            //this.rvResep.LocalReport.DataSources.Add(_rds);

            ReportDataSource _rds2 = new ReportDataSource();

            _rds2.Name  = "dsResep";
            _rds2.Value = ds2.GetData(_noresep);
            //this.rvResep.LocalReport.DataSources.Add(_rds2);

            //this.rvResep.ZoomMode = ZoomMode.PageWidth;
            //this.rvResep.RefreshReport();

            LocalReport report   = new LocalReport();
            string      path     = Path.GetDirectoryName(Application.ExecutablePath);
            string      fullpath = Path.GetDirectoryName(Application.ExecutablePath).Remove(path.Length - 10) + @"\Reports\reportResep.rdlc";

            report.ReportPath = fullpath;
            MessageBox.Show(fullpath);
            report.DataSources.Add(_rds);
            report.DataSources.Add(_rds2);

            PrintReport.PrintToPrinter(report, _numofcopies);
        }
예제 #3
0
        private void printResep()
        {
            var ds = new Dataset.yakkumdbTableAdapters.data_pasienTableAdapter();

            ds.ClearBeforeFill = true;
            ds.Fill(yakkumdb.data_pasien, _noresep);

            var ds2 = new Dataset.yakkumdbTableAdapters.data_resepTableAdapter();

            ds2.ClearBeforeFill = true;
            ds2.Fill(yakkumdb.data_resep, _noresep);

            var ds3 = new Dataset.rmdbTableAdapters.diagnosa_utamaTableAdapter();

            ds3.ClearBeforeFill = true;

            ds3.Fill(rmdb.diagnosa_utama, _noreg);

            var ds4 = new Dataset.rmdbTableAdapters.RMIcdSekunderRalanTableAdapter();

            ds4.ClearBeforeFill = true;
            ds4.Fill(rmdb.RMIcdSekunderRalan, _noreg);

            var ds5 = new Dataset.yakkumdbTableAdapters.fa_rx_tindakanTableAdapter();

            ds5.ClearBeforeFill = true;
            ds5.Fill(yakkumdb.fa_rx_tindakan, _noresep);

            var ds6 = new Dataset.yakkumdbTableAdapters.fa_rx_prosedurTableAdapter();

            ds6.ClearBeforeFill = true;
            ds6.Fill(yakkumdb.fa_rx_prosedur, _noreg);

            var ds7 = new Dataset.yakkumdbTableAdapters.fa_rx_resep_hTableAdapter();

            ds7.ClearBeforeFill = true;
            ds7.FillByKdResep(yakkumdb.fa_rx_resep_h, _noresep);
            //this.rvResep.LocalReport.DataSources.Clear();

            ReportDataSource _rds = new ReportDataSource();

            _rds.Name  = "dsPasien";
            _rds.Value = ds.GetData(_noresep);
            //this.rvResep.LocalReport.DataSources.Add(_rds);

            ReportDataSource _rds2 = new ReportDataSource();

            _rds2.Name  = "dsResep";
            _rds2.Value = ds2.GetData(_noresep);
            //this.rvResep.LocalReport.DataSources.Add(_rds2);

            ReportDataSource _rds3 = new ReportDataSource();

            _rds3.Name  = "dsDiagnosa";
            _rds3.Value = ds3.GetData(_noreg);

            ReportDataSource _rds4 = new ReportDataSource();

            _rds4.Name  = "dsDiagSec";
            _rds4.Value = ds4.GetData(_noreg);

            ReportDataSource _rds5 = new ReportDataSource();

            _rds5.Name  = "dsTindakanPer";
            _rds5.Value = ds5.GetData(_noresep);

            ReportDataSource _rds6 = new ReportDataSource();

            _rds6.Name  = "dsProcedure";
            _rds6.Value = ds6.GetData(_noreg);

            ReportDataSource _rds7 = new ReportDataSource();

            _rds7.Name  = "dsResepH";
            _rds7.Value = ds6.GetData(_noreg);
            //this.rvResep.ZoomMode = ZoomMode.PageWidth;
            //this.rvResep.RefreshReport();

            LocalReport report = new LocalReport();

            //string path = Path.GetDirectoryName(Application.ExecutablePath);
            //string fullpath = @"C:\rse.app.resource\Reports\reportResep.rdlc";
            //report.ReportPath = fullpath;
            report.ReportEmbeddedResource = "rse.app.desk.rx.pharmacist.Reports.reportResep.rdlc";
            report.DataSources.Add(_rds);
            report.DataSources.Add(_rds2);
            report.DataSources.Add(_rds3);
            report.DataSources.Add(_rds4);
            report.DataSources.Add(_rds5);
            report.DataSources.Add(_rds6);
            report.DataSources.Add(_rds7);

            for (int q = 1; q <= _numofcopies; q++)
            {
                PrintReport.PrintToPrinter(report, _numofcopies);
            }


            var _year     = DateTime.Now.ToString("yyyy");
            var _month    = DateTime.Now.ToString("MM");
            var _day      = DateTime.Now.ToString("dd");
            var _datepath = _year + @"\" + _month + @"\" + _day;
            var _filename = _sep + "_resep.Pdf";
            //string _path = @"\\192.168.2.222\Sharing Is Caring\ResepFarmasiSementara\" + _datepath + @"\" + _filename;
            string _path = @"\\192.168.10.11\Data SEP\Casemix RJ\FARMASI RJ\" + _datepath + @"\" + _filename;

            Functions.SavePDF.SavedPDF(report, _path);
        }