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.
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?
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.