One to Mane Relation

Stimulsoft Reports.WEB discussion
Post Reply
Master600
Posts: 2
Joined: Wed Feb 28, 2018 5:38 pm

One to Mane Relation

Post by Master600 »

hi
I have a new situation, and explain it. I'll appreciate for your guidance.

I have a Master and a detail table. in master table i have 4 columns which hold the id of the second table, and we need to retrieve the text(Value) of these Ids in my report.
Here is part of table design:
Image

in simple master detail relations we can choose the field from master table, and the Id of the second table and make the relation.
in this scenario i need to have 3 to 1 relation (3 in master and one in detail) to retrieve the names.
I hope this explanation was clear.

Thanks
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: One to Mane Relation

Post by Edward »

Hi Master600,

Please correct me if I am wrong, but it looks like you have a composite primary key in Table1 which is
id1
id2
id3

So you can create a relation in the Data Dictionary that will link your master and the detail tables based on 3 columns. Please have a look:
https://www.youtube.com/watch?v=L4L2B9y9Cgs

https://www.stimulsoft.com/en/documenta ... lation.htm

Thank you,
Edward
Master600
Posts: 2
Joined: Wed Feb 28, 2018 5:38 pm

Re: One to Mane Relation

Post by Master600 »

Thanks for your reply Edward
I use simple relations like the one you mentioned. but what i need is a one-to-many relation. in fact one-to-three.

Image

i need this kind of relation which you see in picture.
The contractorId in first table have different values (all are int which are the table 2 Ids), and i need to retrieve the name of contractors from second table.
it doesn't seem correct to use 4 relations for this scenario.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: One to Mane Relation

Post by Edward »

Hi Master600,

Sorry, I am a bit slow on that. Could you please attach some sample data in Excel or any other convenient for you format here, and we will try to build the report according to your requirements.
Please have a look also at the following sample report which is a bit different from what you described, but I think we could build your solution using the similar technique:

http://demo.stimulsoft.com/#Net/MasterDetailSubdetail
mater-detail-subdetail.png
mater-detail-subdetail.png (133.13 KiB) Viewed 1312 times
Thank you,
Edward
Post Reply