Question

I can accomplish the grouping in Data Report using the Data Environment smoothly. But I want to create the grouping via code using the GROUP BY statement.

I have this code but an error occurs saying Report sections do not match data source.

SELECT 
G.Code, G.Description, COUNT(E.EmpNo), COUNT(E.EmpName) FROM tblEmployee E
INNER JOIN tblEmployeeGroups EG
ON E.EmpNo=EG.EmpID
INNER JOIN tblGroup G
ON EG.GroupID=G.Code
GROUP BY G.Code, G.Description
ORDER BY G.Code ASC

Is it only possible to accomplish this via Data Environment?

Was it helpful?

Solution

Rewrite your query to use the Data Shaping Provider. This has a SQL-like SHAPE command for creating hierarchical rowsets

That is what the Data Environment does under the covers.

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