Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            pre_coinsAndDebts rpt = new pre_coinsAndDebts();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            Pre_Month_DebtsCoinEntryCLS.month    = dtpYearMonth.Value.Year;
            Pre_Month_DebtsCoinEntryCLS.month    = dtpYearMonth.Value.Month;
            Pre_Month_DebtsCoinEntryCLS.routCode = cmbRoute.SelectedValue.ToString();
            DataSet   ds = new DataSet();
            DataTable dt = Pre_Month_DebtsCoinEntryCLS.getSupllierByRouteCode();

            ds.Tables.Add(dt);
            ds.WriteXml("myCOins.xml");

            pre_coinsAndDebts myRpt          = new pre_coinsAndDebts();
            ReportViewer      myReportViewer = new ReportViewer();


            myRpt.SetDataSource(ds);
            myRpt.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName());
            myRpt.SetParameterValue("Year", Pre_Month_DebtsCoinEntryCLS.year);
            myRpt.SetParameterValue("Month", CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Pre_Month_DebtsCoinEntryCLS.month));
            myReportViewer.crystalReportViewer1.ReportSource = myRpt;
            myReportViewer.Show();
        }