Export grouped report - wron gropu names

Romio68

Registered User.
Local time
Today, 21:59
Joined
Sep 4, 2013
Messages
27
Access 2007 and 2013 with Excel 2013

A weird behavior in exporting report
I have a report with a group by a certain criteria (only one level group)
Looks nice and neat but...:banghead:
When i export the group to excel using
DoCmd.OutputTo acOutputReport, reportname, acFormatXLS, theFilePath & theFileName, False, , , acExportQualityPrint
the output is messed up.

Group contents are ok, but group names are messed
First group name is OK
Second is OK
Starting with the third group, all group names are wrong. It is actually the second group name propagated up to the end.

Instead of
Groupname A
1
2
3
Groupname B
4
5
6
Groupname C
7
8
9
Groupname D
...

I have

Groupname A
1
2
3
Groupname B
4
5
6
Groupname B (again)
7
8
9
Groupname B (again)
...
 
Check the report grouping stack. Do you have an extra field in it?
Are the groups numbers in a string field, but behaving as strings instead of numeric?
 
No such situation
Please explain what do you think may produce this output while exporting the report
 
There's something in your data or grouping causing it, you're just missing it.
 
It seems i found it
The group name is a local (report) calculated field. It is not coming from the query.
Access displays properly the report, but when data is exported, the above output comes out.
The workaround is to calculate the field inside the query and pull it into the report.
But if you have a solution for the report itself to be able to deal with calculated fields, it will be appreciated
 

Users who are viewing this thread

Back
Top Bottom