Ejemplo n.º 1
0
        private rpt3 CreateReport3()
        {
            // Create a new report instance.
            rpt3 report = new rpt3();

            try
            {
                // Assign the data source to the report.
                report.DataSource = DataSourceToBind();
                //report.DataMember = "customQuery";

                report.TotalQty = DTotalQty; // RptSalesTotals.TotalQty;
                report.TotalAmt = DTotalAmt; //RptSalesTotals.TotalAmt;

                report.StoreName = StoreName;
                report.ParamDate = ParamDate;

                report.TotalPercent = DTotalPercent;
                report.DiscountAmt  = DTotalDiscountAmt;
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }

            return(report);
        }
Ejemplo n.º 2
0
        public void LoadReport(LoadReportType ReportType)
        {
            if (ParamDate.Count == 0)
            {
                MessageBox.Show("No date parameter selected.", "Parameter Required", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                reportType = ReportType;
                switch (ReportType)
                {
                case LoadReportType.NetSalesByServiceType:
                    if (Rpt1 == null)
                    {
                        Rpt1 = CreateReport1();
                    }
                    DV.DocumentSource = Rpt1;
                    Rpt1.CreateDocument();
                    //rpt1.ShowPreviewDialog();

                    break;

                case LoadReportType.GrossSalesSummarybyHours:
                    if (Rpt2 == null)
                    {
                        Rpt2 = CreateReport2();
                    }
                    DV.DocumentSource = Rpt2;
                    Rpt2.CreateDocument();

                    break;

                case LoadReportType.NetSalesByCategory:
                    if (Rpt3 == null)
                    {
                        Rpt3 = CreateReport3();
                    }
                    DV.DocumentSource = Rpt3;
                    Rpt3.CreateDocument();

                    break;

                case LoadReportType.DiscountSummary:
                    if (Rpt4 == null)
                    {
                        Rpt4 = CreateReport4();
                    }
                    DV.DocumentSource = Rpt4;
                    Rpt4.CreateDocument();

                    break;
                }
            }
        }