예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptSalesInterval rpt = new rptSalesInterval();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataSet dsRecords = new DataSet();
                DateTime dtCurrent = DateTime.Now;

                DateTime dtStartofDay = new DateTime(dtPickerStart.Value.Year, dtPickerStart.Value.Month, dtPickerStart.Value.Day, 0, 0, 0);
                DateTime dtEndofDay = new DateTime(dtPickerEnd.Value.Year, dtPickerEnd.Value.Month, dtPickerEnd.Value.Day, 23, 59, 59);
                CReportManager objReportMgnr = new CReportManager();
                CResult objResult = objReportMgnr.GetInventorySalesRecords(dtStartofDay.Ticks, dtEndofDay.Ticks);
                dsRecords = (DataSet)objResult.Data;

                DataTable dtDetails = GetInventroySalesReport(dsRecords);

                if (dsRecords.Tables[0].Rows.Count > 0)
                {
                    Int32 totalCovers = Convert.ToInt32("0" + dsRecords.Tables[0].Rows[0]["guest_count"].ToString());
                    rptSalesInterval objSales = new rptSalesInterval();
                    objSales.SetDataSource(dtDetails);

                    objSales.SetParameterValue(0, dtPickerStart.Value.ToString("dd/MM/yyyy"));
                    objSales.SetParameterValue(1, dtPickerEnd.Value.ToString("dd/MM/yyyy"));
                    objSales.SetParameterValue(2, DateTime.Now.ToString("dd/MM/yyyy"));

                    string reportHeader = RMSAdminController.CollectHeader();
                    string reportFooter = RMSAdminController.CollectFooter();
                    objSales.SetParameterValue(3, reportHeader);
                    objSales.SetParameterValue(4, reportFooter);
                    objSales.SetParameterValue(5, totalCovers.ToString());

                    RecportViewerCtl objRptViewer = new RecportViewerCtl(m_parentForm);
                    objRptViewer.cRptViewerAdmin.ReportSource = objSales;

                    m_parentForm.pnlContext.Controls.Clear();

                    objRptViewer.Parent = this;
                    m_parentForm.pnlContext.Controls.Add(objRptViewer);
                    objRptViewer.Dock = DockStyle.Fill;
                }
                else
                {
                    MessageBox.Show("There is no record.", RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                this.Cursor = Cursors.Default;

            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
예제 #3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptSalesInterval rpt = new rptSalesInterval();
     rpt.Site = this.Site;
     return rpt;
 }