Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptMonthlyAbsentReport rpt = new rptMonthlyAbsentReport();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void absenteeReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmReportOrderBy frm = new frmReportOrderBy("M");

            frm.ShowDialog();
            if (frm.orderby != "")
            {
                SqlConnection  conn = new SqlConnection(RayedoxVariables.connectionstring);
                SqlCommand     cmd;
                SqlDataAdapter da;
                DataSet1       ds        = new DataSet1();
                string         stingadd1 = "select * from view_attendance where present='A' or present='WTP' or present='SUN'" + frm.orderby;
                conn.Open();
                cmd = new SqlCommand(stingadd1, conn);
                da  = new SqlDataAdapter(cmd);
                da.Fill(ds.tblAttendance);
                cmd.Dispose();
                da.Dispose();



                rptMonthlyAbsentReport rpt = new rptMonthlyAbsentReport();
                rpt.SetDataSource(ds);


                crystalReportViewer1.ReportSource = rpt;
                crystalReportViewer1.RefreshReport();

                cmd.Dispose();
                da.Dispose();
                conn.Close();
                try
                {
                    try
                    {
                        rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Text, "D:\\Rayedoxreport.txt" + ".txt");
                    }
                    catch
                    {
                        rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Text, "E:\\Rayedoxreport.txt" + ".txt");
                    }
                }
                catch
                {
                    rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Text, "F:\\Rayedoxreport.txt" + ".txt");
                }
            }
        }