Report columns change on export to Excel (1 Viewer)

AnilBagga

Member
Local time
Today, 17:42
Joined
Apr 9, 2020
Messages
104
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: 13
  • C2.JPG
    C2.JPG
    11.8 KB · Views: 12
  • C1.JPG
    C1.JPG
    10.2 KB · Views: 11

CJ_London

Super Moderator
Staff member
Local time
Today, 12:12
Joined
Feb 19, 2013
Messages
12,570
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, 17:42
Joined
Apr 9, 2020
Messages
104
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, 12:12
Joined
Feb 19, 2013
Messages
12,570
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, 07:12
Joined
Feb 19, 2002
Messages
30,036
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