Report columns change on export to Excel (1 Viewer)

AnilBagga

Member
Local time
Today, 14:12
Joined
Apr 9, 2020
Messages
223
I have a report linked to a query. I changed the names of report headers with spaces eg "Customs Duty paid by" is the report column header where the field name is "CustomsDutyBy"

When I export using the External Data Excel tab, the report header become field names!

The option of export with formatting is greyed out. Is this the reason? How do I set it right?

See the 3 screenshots enclosed
 

Attachments

  • C3.JPG
    C3.JPG
    10.3 KB · Views: 152
  • C2.JPG
    C2.JPG
    11.8 KB · Views: 150
  • C1.JPG
    C1.JPG
    10.2 KB · Views: 195

CJ_London

Super Moderator
Staff member
Local time
Today, 09:42
Joined
Feb 19, 2013
Messages
16,604
exporting data will use field names. But fields have a caption property - so enter your 'spaced' name there, either in the table or (probably better as it is less confusing) the report recordsource query . It should then export using the caption as the column name. Try it with one field to check it works
 

AnilBagga

Member
Local time
Today, 14:12
Joined
Apr 9, 2020
Messages
223
exporting data will use field names. But fields have a caption property - so enter your 'spaced' name there, either in the table or (probably better as it is less confusing) the report recordsource query . It should then export using the caption as the column name. Try it with one field to check it works
Thank you 🙏 (y)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 09:42
Joined
Feb 19, 2013
Messages
16,604
of course, you can always modify the select part your query to

SELECT CustomDutyBy AS [Custom Duty By], .....
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:42
Joined
Feb 19, 2002
Messages
43,257
I don't use the Caption property ever. Although in recent years, MS has fixed some of the bad things that Captions cause. I prefer the alias method in the export query if you want the names to be more user friendly.
 

Users who are viewing this thread

Top Bottom