示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptAging rpt = new rptAging();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
 private void PrintAge()
 {
     custvo                 = new VO.CustomersVO();
     label1.Visible         = false;
     lblOutstanding.Visible = false;
     lblCurrent.Visible     = false;
     lbl30.Visible          = false;
     lbl60.Visible          = false;
     lbl90.Visible          = false;
     lblOver.Visible        = false;
     try
     {
         DataSet   ds = new DataSet();
         DataTable dt = new DataTable();
         dt.Columns.Add("customer", typeof(String));
         dt.Columns.Add("terms", typeof(Int32));
         dt.Columns.Add("duedate", typeof(String));
         dt.Columns.Add("outstanding", typeof(Double));
         dt.Columns.Add("current", typeof(Double));
         dt.Columns.Add("thirty", typeof(Double));
         dt.Columns.Add("sixty", typeof(Double));
         dt.Columns.Add("ninty", typeof(Double));
         dt.Columns.Add("over", typeof(Double));
         //
         foreach (DataGridViewRow dcoe in dataGridView1.Rows)
         {
             dt.Rows.Add(dcoe.Cells[0].Value, dcoe.Cells[1].Value, dcoe.Cells[2].Value, dcoe.Cells[3].Value, dcoe.Cells[4].Value, dcoe.Cells[5].Value, dcoe.Cells[6].Value, dcoe.Cells[7].Value, dcoe.Cells[8].Value);
         }
         ds.Tables.Add(dt);
         ds.WriteXmlSchema("aging.xml");
         crystalReportViewer1.Visible = true;
         btnReturn.Visible            = true;
         //Execute To CReports
         rptAging aging = new rptAging();
         aging.SetDataSource(ds);
         aging.SetParameterValue("DataParam", dtSelect.Text);
         aging.SetParameterValue("prepareParam", custvo.first() + " " + custvo.middle() + " " + custvo.last());
         crystalReportViewer1.ReportSource = aging;
     }
     catch (Exception)
     {
     }
 }