public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CoinAnalysisDivisionWiseRPT rpt = new CoinAnalysisDivisionWiseRPT();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void btnSummary_Click(object sender, EventArgs e)
        {
            DataSet dataSetReport = new DataSet();

            dataSetReport = myReports.getDivisionWiseCoinAnalysis(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()));
            //dataSetReport = myReports.getDivisionWiseCoinAnalysisWithBalance(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()));
            dataSetReport.WriteXml("DvisionWiseCoinAnalysis.xml");

            if (dataSetReport.Tables[0].Rows.Count > 0)
            {
                CoinAnalysisDivisionWiseRPT myaclist = new CoinAnalysisDivisionWiseRPT();
                myaclist.SetDataSource(dataSetReport);
                ReportViewer myReportViewer = new ReportViewer();

                myaclist.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                myaclist.SetParameterValue("Estate", mydiv.ListEstates().Rows[0][0].ToString());
                myaclist.SetParameterValue("Period", "Month of : " + cmbMonth.Text + "/" + cmbYear.Text);
                myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                myReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data to preview..!");
            }
        }