Question

Hello every body i have one trouble i have one report like this

enter image description here

Well what i am doing is Dataset 1. Country master table 2. Event master table

USing dataset to display country and event both well every thing is working perfectly except what i want is Based on country id events should be displayed here where i am stuck because i don't have very much hand on this one and also by googling i found some solution which doesn't work for me can any one provide me help one this thanks in advance

[Updated]

data is displayed fine but i want to display events fro each row based on country display in first row of subreport where country id =main report.country id this should be repeated in every row

Was it helpful?

Solution

Have you tried to add the table 2 to subreport datasource? it should be somenthing like this

ReportDocument report = new ReportDocument();
report.Subreports["mySubReport.rpt"].SetDataSource(ds.Tables[1]);
or
report.Subreports[0].SetDataSource(ds.Tables[1]);

UPDATE

I think you can achieve it passing the contry id to the subreport with events. Right-click on the subreport object and choose Change SubReport Links, it will open this windows, from here from the available fields you select your id that refers to event table, I can imagine that's the CountryId, In the bottom part of the window leave the left part as it is, and on the right dropdown select the field to which you want to link you subreport, in your case it could be events.CountryId. In my example I used Customer as main report and Events as subreport

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top