Click here to Skip to main content
14,360,161 members
Rate this:
Please Sign up or sign in to vote.
See more:
I do have RDLC files named MainReport.rdlc and SubReport.rdlc.

Subreport.rdlc (Obviously, act as my subreport).

I was able to display the details of my subreport in my Main Table. but the problem is that the subreport displays all the data on each row in my subreport

What I want is this:
================================================================================
   Scope         Tasks           Quality           Quantity         Accuracy
================================================================================
  Scope 1      Task # 1         3 - Amazing                       3 - Perfect
               Task # 2         2 - Good                          2 - Less Error
               Task # 3         1 - Bad                           1 - Many Error
================================================================================
  Scope 2      Task # 4         3 - Amazing      3 - Too many
               Task # 5         2 - Good         2 - Enough
                                1 - Bad          1 - Lacking
================================================================================

But what is happening is this:
================================================================================
   Scope         Tasks           Quality           Quantity         Accuracy
================================================================================
  Scope 1      Task # 1         3 - Amazing                       3 - Perfect
               Task # 2         2 - Good                          2 - Less Error
               Task # 3         1 - Bad                           1 - Many Error
               Task # 4         
               Task # 5         
================================================================================
  Scope 2      Task # 1         3 - Amazing      3 - Too many
               Task # 2         2 - Good         2 - Enough
               Task # 3         1 - Bad          1 - Lacking
               Task # 4         
               Task # 5
================================================================================


What I have tried:

The dataset query on MainReport
Select DISTINCT tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment,Rating.fldQuality, Rating.fldQuantity, Rating.fldAccuracy from tblMain 
JOIN tblScope as SCOPE on  tblMain.Scope = Scope.Id
LEFT JOIN tblRatings as Rating on tblMain.RatingRefCode = Rating.ScopeCode 
where tblMain.ID_Num = @RefNo AND fldDate between @Start and @End
Group By tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment,Rating.fldQuality, Rating.fldQuantity, Rating.fldAccuracy

Here is the dataset query on Subreport
Select DISTINCT tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment from tblMain 
JOIN tblScope as SCOPE on  tblMain.Scope = Scope.Id
LEFT JOIN tblRatings as Rating on tblMain.RatingRefCode = Rating.ScopeCode 
where tblMain.ID_Num = @RefNo AND fldDate between @Start and @End
Group By tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment
Posted
Updated 31-Oct-19 3:49am
v2
Comments
St0rmi 5-Nov-19 7:28am
   
Assuming you are using MSSQL you could use the SQL Profiler to see the SQL query of the Subreport that's fired against the database. This will give you the chance of manually check the SQL against the database and find the error. If you still need help, it would be helpful to have some example data of the tables tblMain,tblScope and tblRatings.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100