2

We all are familiar with programming in 3 layers I'm trying to Programming 3 layers with DTO as simple concept and create test report with Stimul But there was trouble on the way to I wrote the following two simple classes

http://uimg.in/images/2012/11/02/L6eHl.png

And for retrieve some data use static class and below data (very simple and common)

http://uimg.in/images/2012/11/02/9sVIb.png

In my test report I need get information of University native student for this goal I used very simple linq join as below

http://uimg.in/images/2012/11/02/yvmJk.png

NOW all things is correct and “list” variable return correct data

http://uimg.in/images/2012/11/02/7owOj.png

NOW let`s Start Create My Report 1. In Dictionary Section I add NEW DATA SOURCE and select Data From Business Objects 2. Add Student & College Class from “Common.dll” 3. Drag and Drop Student to Page as Table

http://uimg.in/images/2012/11/02/HGSy.png

BUT My Problem is this : Why two Columns (College Name – Professor Name) have Repetition Records ? How I can correct records ?!

http://uimg.in/images/2012/11/02/opy1Y.png

Can anyone modify and correct my attachment ?!

I think that in StimulSoft should be a way to solve the problem I do not see a problem with the code! Seems linq does not have problem If stimul can accept multiple data source my problem will solve when I change table data source to student, student data correct but college data is repetition when I change table data source to college , college data correct but student data is repetition !!!

http://uimg.in/images/2012/11/02/laSnz.png

Attachment :

http://www.putlocker.com/file/AAD881D281CCF8FB

http://www.smallfiles.org/download/3311/RptTest.rar.html

Steve
  • 213,761
  • 22
  • 232
  • 286

2 Answers2

0

You should set a relation between your business objects and use it.

HighAley
  • 1,257
  • 1
  • 8
  • 20
0

u should use distinct in your select query and also u can use lambda expression in order to distinct your model

list = list.orderby(item => item.CollegeName).select(grp => grp.first()).tolist();

or for more column

list = list.orderby(item => item.CollegeName).ThenBY(item2 => item2.ProfName)select(grp => grp.first()).tolist();

Hope do well Mahdi Ghafoorian

Mahdi ghafoorian
  • 1,147
  • 10
  • 8