I have a report which should use two tables as datasources. In the report I have the two sources defined with a common source names but different name and alises; i.e. I have
Table 1 - name in source = "interim", name = "players", alias = "players"
Table 2 - name in source = "interim", name = "assess", alias = "assess"
which seems to be right as they appear as separate tables in the report dictionary.
In the C# source code I have
DataTable players = GetBasicPlayerData("118", out filtered);
DataTable assess = GetPlayerAssessmentData("118", out filtered);
StiReport interimreport = new StiReport();
interimreport.Load(appDirectory + "\\interim3.mrt");
interimreport.RegData("interim", "players", players);
interimreport.RegData("interim", "assess", assess);
Now only the last registered set of data works, i.e. in the above example the assess data appears but not the players data, as though one one data table can be registered in the report. I've tried registering this via a dataset, i.e.
DataSet ds = new DataSet("interim");
DataTable players = GetBasicPlayerData("118", out filtered);
DataTable assess = GetPlayerAssessmentData("118", out filtered);
ds.Tables.Add(players);
ds.Tables.Add(assess);
StiReport interimreport = new StiReport();
interimreport.Load(appDirectory + "\\interim3.mrt");
interimreport.RegData("interim", ds);
but that's even less successful. So what am I missing? how do I get two datatables into a report.
TIA
Adding two datasources to a report
Adding two datasources to a report
hai..
this sample code i was used in my program..
DataSet dtDaftar = _refmt.GetKHKBlank();
dtDaftar.Tables[0].TableName = "ListOne";
DataSet dtDaftar2 = _refmt.GetTempRow(16);
dtDaftar2.Tables[0].TableName = "ListTwo";
_strpath = Server.MapPath("rpt2.mrt");
_report.Load(_strpath);
_report.Dictionary.DataSources.Clear();
_report.Dictionary.Databases.Clear();
_report.Dictionary.DataStore.Clear();
_report.RegData(dtDaftar);
_report.RegData(dtDaftar2);
_report.Dictionary.Synchronize();
note: ListOne and ListTwo must be same with datasource on report
thanks
this sample code i was used in my program..
DataSet dtDaftar = _refmt.GetKHKBlank();
dtDaftar.Tables[0].TableName = "ListOne";
DataSet dtDaftar2 = _refmt.GetTempRow(16);
dtDaftar2.Tables[0].TableName = "ListTwo";
_strpath = Server.MapPath("rpt2.mrt");
_report.Load(_strpath);
_report.Dictionary.DataSources.Clear();
_report.Dictionary.Databases.Clear();
_report.Dictionary.DataStore.Clear();
_report.RegData(dtDaftar);
_report.RegData(dtDaftar2);
_report.Dictionary.Synchronize();
note: ListOne and ListTwo must be same with datasource on report
thanks