Crystal Reports 2008 / .Net DataTable with Spaces in Column Names

I needed to take an existing .Net DataTable that exists in a program we have and feed it to Crystal Reports. To do this, I went the route of creating an XML file that corresponded to the columns in the DataTable, point Crystal to that and then place the elements on the form. The only problem was, this specific table had spaces in the column names and for outside circumstances, it could not be changed and XML does not accept spaces in tag names. The answer, use XML’s escape character for the space. Let’s say I have a DataTable with these two fields:

First Name, Last Name

It’s corresponding XML would look something like this (this would show as the ‘people’ table of the data source):

<?xml version="1.0" encoding="utf-8" ?>

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.