Page 1 of 1
Multiple Regdata
Posted: Tue Sep 22, 2009 3:51 am
by jayanthi
Hai,
Am having 2 tables, tbl_Company, tbl_Claims; which has common field as CompanyID.
Now through code how to add the two tables to DataSource and to set relation.
Regards
Jay
Multiple Regdata
Posted: Tue Sep 22, 2009 6:57 am
by Jan
Hello Jay,
Can you say where placed this tables? In same DataSet? or not in DataSet?
Thank you.
Multiple Regdata
Posted: Tue Sep 22, 2009 7:28 am
by jayanthi
Hai Jan,
Am using different dataset.
In report i have created connection with 2 tables tbl_company,vw_claims.
In run time through code am clearing the datasource and based on query am creating vw_Claims datasoruce using RegData. But am not able to add tbl_Company to that same datasource.
Thanx
Jay
Multiple Regdata
Posted: Wed Sep 23, 2009 7:29 am
by Jan
Hello Jay,
At first you can create relation between datatables which placed in different datasets. This is restriction of ado.net. So you need set special property of StiReport component - CacheAllData to true. You can do this from report designer. After then you can add relation directly in report designer and report engine will create it before report rendering in special cache.
Thank you.
Multiple Regdata
Posted: Tue Sep 29, 2009 12:51 am
by jayanthi
Hai,
I set CacheAllData=True
I have added 2 separate tables like Tabl1, Tabl2 in report designer which has common field as 'RecordNo'.
Then created a relation between them as like:
Parent Datasource as: Tabl1
Child Datasource as: Tabl1
Parent Columns: RecordNo
Child Columns: RecordNo
Give Relation through code as like below:
Dim dataRelation As Dictionary.StiDataRelation
dataRelation = New Dictionary.StiDataRelation("MyRecordNo", report.Dictionary.DataSources("Tabl1"), report.Dictionary.DataSources("Tabl2"), New System.String() {"RecordNo"}, New System.String() {"RecordNo"})
report.Dictionary.RegRelations()
report.Dictionary.Relations.Add(dataRelation)
Add Datasource as like below:
report.RegData("DataSource", ds.Tables("Tabl1"))
But it throws error like:
Tabl2 is not a member of report.Tabl1Datasource: Type 'ParentMyRecordNo' is not defined.
Please guide me how to add relation and multiple datasource through source code.
Thank you
Jay
Multiple Regdata
Posted: Wed Sep 30, 2009 9:08 am
by Andrew
Hello,
Could you please send a sample project which reproduces the issue to
support@stimulsoft.com.
Thank you.