>>>>>>Hey gang,
>>>>>>Here is my situation - I am attempting to build a generic Crystal Reports class where the end-user provides a path to the .rpt file, a path to an .xml file, and other options on how to export the report. A requirement is for the .xml file to have an external schema.
>>>>>>
>>>>>>In my class, I am importing the .xml into an un-typed DataSet using the DataSet.ReadXML method and passing that into the report. The problem is that all of my fields are converted to strings somehow and it my report I get errors when I try to multiply two numeric values in a formula.
>>>>>>
>>>>>>How can I make this work so the types of my values are preserved?
>>>>>>
>>>>>>Thanks!!!
>>>>>>
>>>>>>EDIT, this isn't an ASP.NET post - somehow that got incorrectly set.
>>>>>
>>>>>DataSet.ReadXML has a couple of overloads. Did you look into them? One of the overloads should read the schema of the XML before reading the data.
>>>>
>>>>Yes, I looked at those but I think they only read an inline schema. I found a ReadXMLSchema method where I can define the actual .xsd file and then the DataSet becomes strongly typed. However I can't seem to successfully read the data in using ReadXML after I do this.
>>>
>>>Try using xmlreadmode IgnoreSchema or InferSchema in ReadXml after using ReadXmlSchema.
>>>Are you sure that your data matches your schema?
>>
>>Einar,
>>Using teh InferSchema option was the key. It works now. Thanks!!
>
>Glad to hear it works. I also use InferSchema.
I am surprised it didn't work with IgnoreSchema. The description of InferSchema specifically mentioned an inline schema, and I figured if I already had the DataSet defined with ReadXMLSchema then I should be done with schemas. Oh well, if I question it too much I might jinx it.