Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crBonus__Instrument__Receive__Report__DSE__21_3 rpt = new crBonus__Instrument__Receive__Report__DSE__21_3();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void btnViewReport_Click(object sender, EventArgs e)
        {
            Bonus_Instrument_Receive_Report_DSE_21_3BAL objBAL = new Bonus_Instrument_Receive_Report_DSE_21_3BAL();
            DataTable       data      = new DataTable();
            frmReportViewer rptviewer = new frmReportViewer();
            crBonus__Instrument__Receive__Report__DSE__21_3 objrpt = new crBonus__Instrument__Receive__Report__DSE__21_3();

            try
            {
                CheckValidation();
                SetInstrumentInfo();
                if (_instrumentId != "" && _instrumentName == "")
                {
                    //data = objBAL.BonusInstrumentReceiveReportData(dtpFromDate.Value, dtpToDate.Value, _instrumentId, "");
                    _instrumentName = GetInstrumentNameByInstrumentID(_instrumentId);
                }
                else if (_instrumentId == "" && _instrumentName != "")
                {
                    //data = objBAL.BonusInstrumentReceiveReportData(dtpFromDate.Value, dtpToDate.Value, "", _instrumentName);
                    _instrumentId = GetInstrumentIDByInstrumentName(_instrumentName);
                }

                data = objBAL.BonusInstrumentReceiveReportData(dtpFromDate.Value, dtpToDate.Value, _instrumentId, _instrumentName);
                objrpt.SetDataSource(data);
                ((TextObject)objrpt.Section2.ReportObjects["txtfromDate"]).Text = Convert.ToDateTime(dtpFromDate.Value.ToString()).ToString("dd/MM/yyyy");
                ((TextObject)(objrpt.Section2.ReportObjects["txttoDate"])).Text = Convert.ToDateTime(dtpToDate.Value.ToShortDateString()).ToString("dd/MM/yyyy");

                rptviewer.crvReportViewer.ReportSource = objrpt;
                rptviewer.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }