3

Error is : Additional information: Parent Data Source 'EmpDetails' and Child Data Source 'SalaryDetails' is not located in one DataSet and can't be used in relation 'EmpSal'! You can use property CacheAllData of report to cache this Data Source to one DataSet.

 public class Employeedetails
 {
    public string EmployeeName { get; set; }
    public string JoiningDate { get; set; }
    public string Designation { get; set; }
    public string Department { get; set; }
    public string Nationality { get; set; }
    public string Status { get; set; }
    public string ContractType { get; set; }
    public string LastWorkingDate { get; set; }
    public string LengthofService { get; set; }
    public string ReasonforExit { get; set; }
    public int EmployeeId { get; set; }
}

public class EmployeeSalaryDetails
{
    public int EmployeeId { get; set; }
    public string AllowanceName { get; set; }
    public string Amount { get; set; }
} 

report.CacheAllData = true;                      
report.Load(Server.MapPath("~/Content/Reports/ReportTemplates/FinalSettlementReport - Copy.mrt"));
report.RegData("EmpDetails", EmployeeDetailsList);
report.RegData("SalaryDetails", EmployeeSalaryList);

this is report designin in stimulsoft

Steve
  • 213,761
  • 22
  • 232
  • 286
Mahesh Chikhale
  • 73
  • 1
  • 10
  • Just an observation, I don't know if this matters or not but I would put the CacheAllData = True AFTER loading the report – Steve Mar 29 '17 at 07:36
  • Hello Steve your observation is correct. After putting CacheAllData = True AFTER loading the report it works for me – Mahesh Chikhale Mar 29 '17 at 11:20

2 Answers2

2
report.Load(Server.MapPath("~/Content/Reports/ReportTemplates/FinalSettlementReport - Copy.mrt"));
                report.RegData("EmpDetails", EmployeeDetailsList);
                report.RegData("SalaryDetails", EmployeeSalaryList);                
                report.RegBusinessObject("SchoolInfoModel", schoolInfo);
                report.CacheAllData = true;

after changing the position of report.CacheAllData = true; after the loading report done it works without error. '

Mahesh Chikhale
  • 73
  • 1
  • 10
0

report.CacheAllData = true;
report.Load(Server.MapPath("~/Content/Reports/ReportTemplates/FinalSettlementReport - Copy.mrt"));

//Use this.

report.Compile();

report.RegData("EmpDetails", EmployeeDetailsList); report.RegData("SalaryDetails", EmployeeSalaryList);

ROOMY
  • 53
  • 8