In VB6, I have a recordset Rs1 that holds the records returned from this query:<br>
<br>
SELECT o.occupation_code, o.occupation_title, oc.category_name <br>
FROM OCCUPATION o, OCCUPATION_CATEGORY oc <br>
WHERE oc.category_num = o.category_num and o.occupation_title like '%farmer%' and o.occupation_title like '%%' and o.occupation_title like '%%' and substring(o.occupation_code,1,3) like '%' and substring(o.occupation_code,5,3) like '%' and substring(o.occupation_code,9,3) like '%' order by oc.category_name ASC, o.occupation_title ASC<br>
<br>
The records are displayed in a grid. I need to allow the users to print the records as well. Since the grid can't print itself, I want to use the recordset as the datasource of a datareport and print that. This works when I just have the category_num and the occupation_title in the detail section of the datareport. But I want to group the results by the category_name. As soon as I add a group header section to the datareport, even without adding any controls to it, when I try to show it I get the error "Report sections do not match data source". This seems like it's being much more difficult than it should be. Anyone have any suggestions?
<br>
SELECT o.occupation_code, o.occupation_title, oc.category_name <br>
FROM OCCUPATION o, OCCUPATION_CATEGORY oc <br>
WHERE oc.category_num = o.category_num and o.occupation_title like '%farmer%' and o.occupation_title like '%%' and o.occupation_title like '%%' and substring(o.occupation_code,1,3) like '%' and substring(o.occupation_code,5,3) like '%' and substring(o.occupation_code,9,3) like '%' order by oc.category_name ASC, o.occupation_title ASC<br>
<br>
The records are displayed in a grid. I need to allow the users to print the records as well. Since the grid can't print itself, I want to use the recordset as the datasource of a datareport and print that. This works when I just have the category_num and the occupation_title in the detail section of the datareport. But I want to group the results by the category_name. As soon as I add a group header section to the datareport, even without adding any controls to it, when I try to show it I get the error "Report sections do not match data source". This seems like it's being much more difficult than it should be. Anyone have any suggestions?