AnsweredAssumed Answered

How do I specify field aliases for arcpy.TableToExcel?

Question asked by bkeinath on Sep 22, 2015
Latest reply on Sep 23, 2015 by bkeinath

I'm having trouble specifying field aliases in an excel file I created using arcpy.TableToExcel.  I've specified "ALIAS" but it seems to ignore it.  The field aliases are set within the database.  Can anyone help me with what I'm doing wrong?  Or give me another method?

 

Thanks,


Brandon

import arcpy
defeatureclasspath = r"C:\Users\bkeinath\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\PGISA2_gisadm.sde\GISADM.DistributedEnergy"
arcpy.MakeQueryTable_management(defeatureclasspath,\
                                "CompletedProjectView",\
                                "USE_KEY_FIELDS",\
                                "OBJECTID",\
                                "CUSTOMERLASTNAME; ACCOUNTNUMBER; PROJECTIDENTIFIER; SYSTEMSIZE; CUSTOMERMAILINGADDRESS; PUCPREID; PUCFINALID; APPLICATIONDATE; ACTUALONLINEDATE")


#Create excel file from CompletedProjectView
arcpy.TableToExcel_conversion("CompletedProjectView", r"E:\temp\CompletedProjects.xls", "ALIAS")

Outcomes