Click here to Skip to main content
12,243,192 members (32,189 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
Dear Friends,

Here I am Facing a Typical Problem in RDLC Reports. Actually I have 3 types of datasets. In first time, I have bound the dataset to table in rdlc reports. Through for loop second and third datasets I am Going to Bind, but the Output of the Report I am getting only third Dataset. I am unable to see the output of remaining datasets. I have written the code like this.
private void BindEmpGrades()
       {
           try
           {
               SchGradesBL schGradeBL = new SchGradesBL();
 
               SchGradesBO schGradesBO = new SchGradesBO();
               schGradesBO.SchoolType = General_Constants.EducationLevelID.ToString();
               schGradesBO.SchoolID = General_Constants.SchoolID;
               schGradesBO.AcademicYearID = General_Constants.AcademicYearID;
               dataTableEmpGradeWise = schGradeBL.GetGradeAndSections(schGradesBO);//GetGradeAndSections(schGradesBO);
               if (dataTableEmpGradeWise.Rows.Count > 0)
               {
                   for (int i = 0; i < dataTableEmpGradeWise.Rows.Count; i++)
                   {
 
                       SectionId = dataTableEmpGradeWise.Rows[i][0].ToString();
                       GradeId = dataTableEmpGradeWise.Rows[i][1].ToString();
                       EmpPresentInfoBL empPresentInfoBL = new EmpPresentInfoBL();
                       EmpPresentInfoBO empPresentInfoBO = new EmpPresentInfoBO();
                       empPresentInfoBO.SectionID = Convert.ToInt32(SectionId);
                       empPresentInfoBO.GradeID = Convert.ToInt32(GradeId);
                       empPresentInfoBO.SchoolID = General_Constants.SchoolID;
 
                       dataTableEmpSectionWise = empPresentInfoBL.GetEmployeesByGradeSection(empPresentInfoBO);
 

                       this.rptEducatorActivities.RefreshReport();
 
                       string str = Application.StartupPath;
                       string str2 = str.Replace(@"SEMIS_Start\bin\x64\Debug", "");
                       this.rptEducatorActivities.LocalReport.ReportPath = str2 + @"Zanzibar\XtraReports\Modules\Forms\XtrRptEmpGradeWise_en.rdlc";
 
                       TotalSubReports();
                   }
 

               }
               else
               {
                   //this.parameter1.Value = 0;
               }
           }
           catch (Exception ee)
           {
               //LoadErrorsLog.ErrorMethod(ee.Message, this.Name, "BindDisabilityWise");
           }
       }
       private void TotalSubReports()
       {
           rptEducatorActivities.LocalReport.DataSources.Add(new ReportDataSource("ds", dataTableEmpSectionWise));
 
           if (SectionId == "406")
           {
               ReportParameter[] paramtr = new ReportParameter[2];
 
               GradeName = dataTableEmpSectionWise.Rows[0][6].ToString();
               SectionName = dataTableEmpSectionWise.Rows[0][7].ToString();
 
               paramtr[0] = new ReportParameter("GradeName", GradeName);
               paramtr[1] = new ReportParameter("SectionName", SectionName);
               rptEducatorActivities.LocalReport.SetParameters(paramtr);
               rptEducatorActivities.RefreshReport();
           }
           if (SectionId == "413")
           {
               ReportParameter[] paramtr1 = new ReportParameter[2];
 
              GradeName = dataTableEmpSectionWise.Rows[0][6].ToString();
              SectionName = dataTableEmpSectionWise.Rows[0][7].ToString();
 
              paramtr1[0] = new ReportParameter("GradeNameB", GradeName);
               paramtr1[1] = new ReportParameter("SectionNameB", SectionName);
              rptEducatorActivities.LocalReport.SetParameters(paramtr1);
              rptEducatorActivities.RefreshReport();
           }
               if (SectionId == "406")
               {
                   ReportDataSource rds = new ReportDataSource("detempattd", dataTableEmpSectionWise);
 
                   rptEducatorActivities.LocalReport.DataSources.Add(rds);
                   this.rptEducatorActivities.RefreshReport();
               }
 
           if (SectionId == "413")
           {
               ReportDataSource rds = new ReportDataSource("dtempatt", dataTableEmpSectionWise);
 
               rptEducatorActivities.LocalReport.DataSources.Add(rds);
               this.rptEducatorActivities.RefreshReport();
           }
 
       }
Posted 21-Nov-12 23:46pm
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100