Zum Hauptinhalt gehen

DataTable to XLS losing Display Names

Kommentare

5 Kommentare

  • Permanently deleted user

    Just bumping this to see if anyone has some suggestions.

    I have a user creating a mailing list that she has to manually change the column names because mail merge fails with column names that look like:

    "MantaImage.ARCGISPROD.%Manta_Property_Owner_Mailing_Addresses_Formatted.DELIVERY_ADDR" instead of "Address"

    Thanks.

    0
  • Permanently deleted user

    Bumping again.

    I would really like an answer or explanation on this issue if possible.

    I have implemented a mailling list application for our Clerks department to replace a mapguide app.  These oddly named field headings are causing them problems in their process to create a mail merge.  

    Please someone give me some direction on this.

    Thanks!

    0
  • Ryan Cooney

    Hi Bret,

    This is a two parter:

    • The FeatureSetToDataTable activity does not currently apply the FeatureSet FieldAlias values to the Captions of the DataColumns.
    • The DataTableToXls activity does not currently apply the DataColumn Caption values to the XLS document.

    We will consider both of these for inclusion in a future version of the software.

     

    There is a work around. You need to loop through the Columns of the DataTable and overwrite their ColumnName values to match the aliases in the FeatureSet. Then when you use DataTableToXls it will have the column names you want.

    --Ryan

     

    0
  • Justin Kraemer

    I'm trying to do the described "loop through the Columns of the DataTable and overwrite their ColumnName values", but am stuck on how to actually implement it. Reason I need this is I have a DataTable with ridiculously long field names I want to rename before the export to Excel, but I cannot figure out how to set up a For Each <T> to do the loop. Any type I've used for the <T> gives me Implicit Conversion errrors. System.Data.DataTable and System.Data.DataTable[} are two examples of what I've tried for <T>. Perhaps I need to use something else entirely. Please help.

    0
  • Justin Kraemer

    Works perfectly. Thanks so much, Nico!

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.