Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone,
I am making a crystal report with this SQl:
C#
string sql = "select * from tbl_Student S inner join tbl_Result R on S.ID=R.ID_Student where S.ID=@ID";       


I have 2 tables:

Table Student
ID| Name
01 | Jimmy
02 | Tom

Table Result
ID_Student|ID_Course|Result
01 |01 | A+
01 |02 | C
02 |01 | B+
02 |02 | A

My preview button :
C#
 frmDisplayReport report = new frmDisplayReport();
 report.getDBO = this.dbo;
 report.getSID = dtp.Value.ToString("ddMMyy") + "-" + txtSeq.Text;
string sql = "select * from tbl_Student S inner join tbl_Result R on S.ID=R.ID_Student where S.ID=@ID";
 report.ViewReport("CrystalReport1.rpt",sql);
 report.ShowDialog();


and my "ViewReport" with ID ( always have value) :

C#
internal void ViewReport(string reportName,string SQL)
        {
            DataSet ds = new DataSet();
            ds=dbo.ds_selectionSQL(SQL,ID);
            ReportDocument rd = new ReportDocument();
            string reppath = @"C:\Users\Toki Burke\Desktop\working\shigoto\Revive\Rvive\Report\CrystalReport1.rpt";
            rd.Load(reppath);
            rd.SetDataSource(ds.Tables[0]);
            ReportViewer1.ReportSource = rd;
            
        }


But the crystal report repeats a record of "(section 3) Details" for 5-6 times and then move to next report and repeat 5-6 times....

My "(section2) Page header" contains information of students, and my "(section3) Details" is with result of each course.

I want to data of "(section 3) Details" not to repeat.
This is my first time with crystal report (^.^!).
Sorry, my English is bad.

Please help me.
Thank in advance.
Posted
Updated 4-May-15 3:56am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900