Multiple Regdata

Stimulsoft Reports.NET discussion
Post Reply
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

Multiple Regdata

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Multiple Regdata

Post by Jan »

Hello Jay,

Can you say where placed this tables? In same DataSet? or not in DataSet?

Thank you.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

Multiple Regdata

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Multiple Regdata

Post 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.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

Multiple Regdata

Post 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
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Multiple Regdata

Post by Andrew »

Hello,

Could you please send a sample project which reproduces the issue to support@stimulsoft.com.

Thank you.
Post Reply