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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void cmdDisplay1_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dataSetReport = new DataSet();
                dataSetReport = myReports.getLoanRegister(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()));

                if (dataSetReport.Tables[0].Rows.Count > 0)
                {
                    dataSetReport.WriteXml("LoanRegister.xml");
                    LoanRegisterRPT myaclist = new LoanRegisterRPT();
                    myaclist.SetDataSource(dataSetReport);
                    ReportViewer myReportViewer = new ReportViewer();

                    myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                    myaclist.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                    myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                    myReportViewer.Show();
                }

                else
                {
                    MessageBox.Show("No data to preview");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }