cancel
Showing results for 
Search instead for 
Did you mean: 

Have a Crystal Report but not the XSD - how to extract it?

Former Member
0 Kudos

I have a Crystal Report used in an ASP.NET web application where I've just come into a project that I'm assessing/turning around.

The reports are called from a web page or web service and are sent an ADO.NET dataset - using ReportDocument.SetDataSource for some tables with a relation etc - all defined largely in code - initially loaded from the database, but it looks like some data is even altered after load in the datasets. (don't ask)

I have several XSDs (and a whole bunch of source repository history) but none seem to match the report, and trial and error to find the right one is taking way too long.

I have added some data in the code, but I cannot get the report to allow me to add fields until I update the report data source, but I don't have the original XSD to point it to. I have to get the report updated to solve immediate needs and then I can address the strategic direction of refactoring this design/architecture.

Is there a way to extract the XSD from the Crystal Report?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello,

Easiest way is to write them both off your data set:

System.Data.DataSet ds = new System.Data.DataSet();

ds.Tables.Add(dt1);

ds.WriteXmlSchema("c:\sc.xml", "c:\sc.xsd");

Thank you

Don

Edited by: Don Williams on Sep 27, 2010 8:49 AM

Remove the double "\" so it doesn't do a line feed

Former Member
0 Kudos

Thanks, this helped a lot. I've got a lot of work to turn around this application, but now I can get some breathing room.

Answers (1)

Answers (1)

former_member188030
Active Contributor
0 Kudos

Hello,

Try using

ds.WriteXml("C:\Temp.xml")

to verify the database.

Thanks,

Bhushan.

0 Kudos

Hi Bhushan,

Problem with just writing the XML part is CR doesn't have the field types defined or the structure. By writing both xml for the data and xsd for the schema setting location works much better. Otherwise all fields are strings and 65 K.

Thank you

Don