Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
SQL
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
SQL
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 2: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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900