Relation 1-n wont work

Stimulsoft Reports.NET discussion
Post Reply
prinzae
Posts: 3
Joined: Mon Oct 14, 2019 9:19 am

Relation 1-n wont work

Post by prinzae »

Hello,

I need some help as using Stimulsoft Designer .NET;

First of all, I have a XML Datasource with some "tables" which could be structured like this:

Code: Select all

<transaction>
	<lines>
		<item>
		</item>
		<discounts>
		</discounts>
		<discounts>
		</discounts>
	</lines>
	<lines>
		[...]
	</lines>	
</transaction>
I have a Databand with datasource as "Lines" (relation "parent/child": item.id/lines.itemId).
For each lines, I'm displaying item's information such as description, price etc.
But I also have to display discount's information so I tried to add a relation on "Lines" (relation "parent/child": discounts.linesId/lines.id).

Since I can have multiple discounts per lines, it looks like it wont work because it gets only the first discounts and not all of them.
I also tried to put another databand as "Discounts" and make "SumIf condition" on Line's databand but I need another condition on the lines id so I get the exact discount for my transaction line and I dont know if I can do that.

Would someone know how I can make it work if my need is correctly detailed.

Thanks for your help,
Prinzae
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Relation 1-n wont work

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
prinzae
Posts: 3
Joined: Mon Oct 14, 2019 9:19 am

Re: Relation 1-n wont work

Post by prinzae »

Hello Lech,

You can find a sample report in attachments.

What I need in column 4 "NET_PRICE W/O DISCOUNT" is:
- 1st line: 0.99
- 2nd line: 4.99
- 3rd line: 3.00
Attachments
Report.xml
(1.33 KiB) Downloaded 107 times
Report.mrt
(11.11 KiB) Downloaded 109 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Relation 1-n wont work

Post by Lech Kulikowski »

Hello,

Please check the modified report in the attachment.

Thank you.
Attachments
Report_modified.mrt
(11.81 KiB) Downloaded 148 times
prinzae
Posts: 3
Joined: Mon Oct 14, 2019 9:19 am

Re: Relation 1-n wont work

Post by prinzae »

So you put datasource, line's relation and master component on discounts databand.

Works like a charm.
Thanks you !!
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Relation 1-n wont work

Post by HighAley »

Hello.

We are always glad to help you.

Thank you.
Post Reply