Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Data to XML converts everything to String Data Type

Status
Not open for further replies.

kebbusobj

Programmer
Jul 17, 2008
29
US
Hello All,

I am new to XML exporting, and I am working with a .NET developer to provide Business Layer data (not persisted) in an XML file that I can pull into a Crystal Report.

Problem is, all data types are converting to String data types, including numeric and currency data in .NET.

Is there not a way to preserve the original data type, when exporting to XML format? I performed a test with the XTreme data set in Access, by exporting a table to .XML format, and saw the same behavior. So, it appears that .XML will only support String data types. Is this correct?

Thank you,
Kristen
 

XML will support any number of datatypes, the question is, does your schema define it? And do your encoders/parsers play nice?

Perhaps there are some libraries out there already, but otherwise I would suggest that you put in some metadata attribute that supplies the datatype and does conversion on that basis.

This might be useful:
 
Hi unomi,

Thank you for the information you supplied here.

My programmer keeps trying to get me what I need, and with his last effort, he provided me two .xml files. A schema file and a data file. I only pulled the data file into Crystal Reports. The data file shows all fields as "string" type, even the Quantity, Price and Date fields. With this said, should I be pulling in the second .xml file that holds the schema and somehow link it to the data in Crystal? If I do, will that change the data type. Is this how it works or should I only have to be dealing with one .xml file. In my mind, I am expecting one .xml file that holds the applicable data with the CORRECT data types, but maybe my expectation is incorrect? Maybe the way this is accomplished in Crystal is with two files, a schema file and a data file?

Your thoughts?

KBoyd
 
unomi,

Let me provide you a little more detail, if I may.

1. I am using the ADO.Net (XML)database connection option in Crystal Reports.

2. The developer actually sent me two .xml files with the following components:

An .xml file that holds two tables: A table that holds all the fields with the CORRECT data types but no data, and a table that holds one ID field.

An .xml file that holds one table that has the same fields as the first table in the other .xml file, has all the data needed, but has the wrong data types.

If I pull the fields from the table that has the data, then the types are not correct. Yet, if I pull the fields in from the table that has the correct data types, then I don't see data. Is the .NET developer sending me the right files in your opinion?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top