Mahesh Chikhale
Mahesh Chikhale

Reputation: 73

I am getting error while working with relation in stimulsoft report

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

Upvotes: 3

Views: 1426

Answers (2)

Mahesh Chikhale
Mahesh Chikhale

Reputation: 73

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. '

Upvotes: 2

ROOMY
ROOMY

Reputation: 53

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);

Upvotes: 0

Related Questions