Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C#
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
v2

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