gpt4 book ai didi

c# - 在 stimulsoft 报告中处理关系时出现错误

转载 作者:行者123 更新时间:2023-12-04 03:13:22 27 4
gpt4 key购买 nike

错误是:附加信息:父数据源“EmpDetails”和子数据源“SalaryDetails”不在一个数据集中,并且不能用于关系“EmpSal”!您可以使用 CacheAllData 的属性报告将此数据源缓存到一个数据集。

 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

最佳答案

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;

改变 report.CacheAllData = true 的位置后;加载报告完成后,它可以正常工作。'

关于c# - 在 stimulsoft 报告中处理关系时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43086410/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com