Hi,
I'm using C# and i have a problem with creating data relations by using code.
How do I convert DataTable into Stimulsoft.Report.Dictionary.DataSource or Please suggest me a way to do creating data relations by using code.
Thank you.
Problem with creating data relations by using code
Problem with creating data relations by using code
Please use the following code for creating of the relation in Dictionary with C#:
for converting DataTable for the DataSource please use the following code:
P.S. the data also could be changed "behind" the DataSource: You can access to the DataTable with actual data with MyDataSource.DataTable property.
Thank you.
Code: Select all
StiDataRelation dataRelation = new StiDataRelation("MyRelation", report.Dictionary.DataSources["Categories"], report.Dictionary.DataSources["Products"], new System.String[]{"CategoryID"}, new System.String[] {"CategoryID"});
report.Dictionary.RegRelations();
report.Dictionary.Relations.Add(dataRelation);
Code: Select all
report.RegData("MyDataSource",myDataTable);
Thank you.