I wrote some code to add relations between the data sources, and I have tried adding them in the recommended way but they do not appear in the designer control's dictionary without manually selecting Actions->Synchronize. I am calling Synchronize from the code but it has no effect.
Code: Select all
report = stiWpfDesignerControl1.Report;
report.Dictionary.Relations.Clear();
//......
//this is inside a loop
if (child != null && parent != null)
{
/*StiDataRelation dataRelation = new Stimulsoft.Report.Dictionary.StiDataRelation(
r.SQLName, r.ParentName, r.ParentName, parent, child, parentid, childid);
report.Dictionary.RegRelations();
report.Dictionary.Relations.Add(dataRelation);*/ //these two methods work exactly the same, I have to manually synchronize to see the relations
report.Dictionary.Relations.Add(
new Stimulsoft.Report.Dictionary.StiDataRelation(
r.SQLName, r.ParentName, r.ParentName, parent, child, parentid, childid)
);
break;
}
//end of loop
//......
report.Dictionary.Synchronize(); //none of this helps to refresh / synchronize the dictionary on the control, it has to be done manually
report.InvokeRefreshViewer();
stiWpfDesignerControl1.Refresh();