Crystal Report, XML and XSD

bharatasp

Member
Joined
Mar 30, 2003
Messages
9
Location
India
Hi all,
I create a report on based an XML File which i create by executing a query and saving the dataset.

Now the problem is that since XML file doesnt have any data type associated, it treats all the fields as text fields and i cannot format my numeric or date fields.

Then I tried to create an XSD file from dataset and created a report from it.
Doing this, i got the data types for fields and was able to create kind of report i required.
Now the problem is :

1. I cannot see any data in reports at design time as my source file is just a schema.

2. While calling that report from page, i cannot save the dataset as XML and fetch the records from that file in case user browses other pages of that report (I wanted to do that for optimization basically)

What i want is that i should be able to specify an Schema defination for the XML File generated from dataset
so that i have datatype defined for my XML files
there is something called InferXmlSchema property of dataset object but i couldnt find how to use it.

Can anyone help me how to achieve this?

Thanks,
 
Try the ReadXmlSchema method. It takes a file name or a stream as its only parameter. The schema should be XSD of course. The DataSet will then apply the schema and enforce the constraints and relations as they are defined.
 
Back
Top