コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            MarkShit rpt = new MarkShit();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            String exam = comboBox1.Text;
            //cmd = new SqlCommand("select ", con);

            SqlDataReader dr = (new SqlCommand("select sub_id,marks from marks where e_id='" + eid + "' and s_grno='" + comboBox2.Text + "'", con)).ExecuteReader();

            List <string> marks = new List <string>();

            marks.Add(comboBox1.Text);                                                                 //Exam Name. COMBOBOX1
            cmd = new SqlCommand("select s_name from std where s_grno='" + comboBox2.Text + "'", con); //GETTING SUBJECT AND MARKS
            SqlDataReader dr1 = cmd.ExecuteReader();

            dr1.Read();
            marks.Add(comboBox2.Text);   //GRNO.
            marks.Add(dr1.GetString(0)); //That GRno Name
            int i = 3;

            while (dr.Read())
            {
                string subject = dr["sub_id"].ToString() + " :";
                string mark    = dr["marks"].ToString();
                marks.Add(subject);
                marks.Add(mark);
                i++;
            }
            if (i < 23)
            {
                for (i = i; i < 23; i++)
                {
                    marks.Add("");
                }
            }

            DataSet_For_Reporting dt = new DataSet_For_Reporting();

            dt.result.AddresultRow(marks[0], marks[1], marks[2], marks[3], marks[4], marks[5], marks[6], marks[7], marks[8], marks[9], marks[10], marks[11], marks[12], marks[13], marks[14], marks[15], marks[16], marks[17], marks[18], marks[19], marks[20], marks[21], marks[22]);
            //dt.result.AddresultRow("BCA Sem Internal", "2015BCA9", "Sharma Anshuman MadanLal", "C Lang.", "32", "PHP", "20", "HTML", "92", "C#", "41", "JavaScript", "44", "Asp.Net", "13", "SQL", "41", "Oracle", "44", "Operating System", "44", "J2EE", "08");

            MarkShit a = new MarkShit();

            a.SetDataSource(dt);
            crystalReportViewer1.ReportSource = a;
        }