Ejemplo n.º 1
0
        private void generateReport()
        {
            CustomerReportData reportDetails = new CustomerReportData();
            CustomerReport     report        = new CustomerReport();
            DataTable          dataTable     = reportDetails.CompanyDetails;

            readCompanyDetails();
            DataRow drr = dataTable.NewRow();

            drr["CompanyName"]    = companyName;
            drr["CompanyDetails"] = companyDetails;
            dataTable.Rows.Add(drr);
            report.Database.Tables["CompanyDetails"].SetDataSource((DataTable)dataTable);
            DataTable daTable = reportDetails.CustomerReportTable;

            storeLists();
            for (int i = 0; i < customerNameList.Count; i++)
            {
                DataRow  drow     = daTable.NewRow();
                string[] custName = Regex.Split(customerNameList[i], "  ");
                drow["CustomerName"]  = custName[0];
                drow["CustomerPhone"] = customerPhoneList[i];
                drow["Credit"]        = creditList[i];
                daTable.Rows.Add(drow);
            }
            DataRow dr = daTable.NewRow();

            dr["TotalCredit"] = creditList.Sum();
            daTable.Rows.Add(dr);
            report.Database.Tables["CustomerReportTable"].SetDataSource((DataTable)daTable);
            customerReportViewer.ViewerCore.ReportSource = report;
            report.Refresh();
        }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CustomerReport rpt = new CustomerReport();

            rpt.Site = this.Site;
            return(rpt);
        }