コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crCustomerInfo rpt = new crCustomerInfo();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void ShowReport(object data)
        {
            _branchId = GlobalVariableBO._branchId;
            string ReportPattern             = data.ToString();
            LoadRPTCustomerInfo loadcustInfo = new LoadRPTCustomerInfo();
            DataTable           dtloaddata   = loadcustInfo.LoadCustomerInfo(ReportPattern, _startDate, _endDate);

            crCustomerInfo crCustInfo = new crCustomerInfo();

            crCustInfo.SetDataSource(dtloaddata);


            GetCommonInfo();
            ///// Load Company Name
            ((TextObject)crCustInfo.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;

            ///// Load Branch Name
            ((TextObject)crCustInfo.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;


            ///// Name of Report Category
            if (_groupName == null)
            {
                ((TextObject)crCustInfo.ReportDefinition.Sections[2].ReportObjects["txtReportCategory"]).Text = "Report Category: " + ReportPattern + " Customer";
            }

            if (_groupName != null)
            {
                ((TextObject)crCustInfo.ReportDefinition.Sections[2].ReportObjects["txtReportCategory"]).Text = "Report Category: " + ReportPattern + " " + _groupName;
                _groupName = null;
            }

            ////// Show Customer Duration
            if (_startDate != null && _endDate != null)
            {
                ((TextObject)crCustInfo.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "Duration : " + _startDate.ToString("dd-MMM-yyyy") + " To " + _endDate.ToString("dd-MMM-yyyy");
            }
            frmViewCustomerInfo frmviewcustinfo = new frmViewCustomerInfo();

            frmviewcustinfo.crvCustomerInfo.ReportSource = crCustInfo;
            frmviewcustinfo.Show();
        }