1
私は2つのテーブル患者とPatientStudy私のデータベースのコードの最初のエンティティフレームワークで作成した。 これらのテーブルは、スタブテーブルの外部キーpatient_idとの関係を持っています。 私のコードは以下の通りです:私はどのようにコードCからのstimulsoftレポートでマスターレポートを作成することができます#
var patbus = new StiBusinessObjectData("Test", "Patient",Patients.ToArray());
var studies=new List<PatientStudy>();
foreach (var patientStudies in Patients.Studies.ToArray())
{
studies.AddRange(patientStudies);
}
var studySrc = new StiBusinessObjectData("Test", "PatientStudy", studies);
report.BusinessObjectsStore.Add(studySrc);
report.BusinessObjectsStore.Add(patbus);
report.Dictionary.Synchronize();
var pds = report.Dictionary.DataSources["Patient"];
var sds = report.Dictionary.DataSources["PatientStudy"];
StiDataRelation rel = new StiDataRelation("Studies", pds, sds, new string[] { "Id" }, new string[] { "Patient_Id" });
report.Dictionary.RegRelation(rel);
report.Dictionary.Relations.Add(rel);
report.Dictionary.Synchronize();
report.DesignWithWpf();
私はこのコードを実行すると、stimulsoftデザインビューで2つのビジネス・オブジェクト・データ(患者とpatientstudy)を加えたが、それらの間の関係は適用されません。 助けが必要 ありがとう