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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void PrintCustomerBuyback(ReportViewer rptViewer)
        {
            IACDataSetTableAdapters.OpenCustomerBuybackTableAdapter OpenCustomerBuybackTableAdapter =
                new IACDataSetTableAdapters.OpenCustomerBuybackTableAdapter();
            IACDataSetTableAdapters.OpenCustomerBuybackSummaryTableAdapter OpenCustomerBuybackSummaryTableAdapter =
                new IACDataSetTableAdapters.OpenCustomerBuybackSummaryTableAdapter();
            String lsType = PaymentTypetextBox.Text.TrimEnd() + "%", lsCode = PAYCODEcomboBox.Text.TrimEnd() + "%",
                   lsDealer = comboBoxDealer.Text.TrimEnd() + "%";

            OpenCustomerBuybackTableAdapter.Fill(iACDataSet.OpenCustomerBuyback, ((DateTime)nullableDateTimePickerEndDate.Value).Date, ((DateTime)nullableDateTimePickerStartDate.Value).Date, lsType, lsCode, lsDealer);
            OpenCustomerBuybackSummaryTableAdapter.Fill(iACDataSet.OpenCustomerBuybackSummary, ((DateTime)nullableDateTimePickerEndDate.Value).Date, ((DateTime)nullableDateTimePickerStartDate.Value).Date, lsType, lsCode, lsDealer);

            if (iACDataSet.OpenCustomerBuyback.Rows.Count == 0)
            {
                MessageBox.Show("*** Sorry there are no OPEN CUSTOMER HISTORY records for the DATES and /or DEALER you selected!!! ***");
            }
            else
            {
                OpenCustomerBuybackReport myReportObject = new OpenCustomerBuybackReport();
                myReportObject.SetDataSource(iACDataSet);
                myReportObject.SetParameterValue("gdStartDate", ((DateTime)nullableDateTimePickerStartDate.Value).Date);
                myReportObject.SetParameterValue("gdEndDate", ((DateTime)nullableDateTimePickerEndDate.Value).Date);
                myReportObject.SetParameterValue("gsUserID", Program.gsUserID);
                myReportObject.SetParameterValue("gsUserName", Program.gsUserName);
                rptViewer.crystalReportViewer.ReportSource = myReportObject;
                rptViewer.crystalReportViewer.Refresh();
                rptViewer.Show();
            }
        }