Friday, October 15, 2010

Adding a new column in Crystal Report: Crystal report with XSD files.

Hi I recently has a had time adding a new column in Crystal Report. I am blogging this in case I again forget or to help if you are stuck too.

To begin: This issue is specifically when Crystal report is tied to XSD file. The CR gets its schema from the XSD. The .NET code populates the XSD.
My environment is
Crystal Report Ver: XI R2
.NET 2.0. But i guess this should work with most of +/- versions.

1. Add column to SQL Proc.
2. Add column to XSD.

3. Add c# code to populate this new Column.
4. Rebuilt Solution.
5. Now comes the main thing, reflecting the new column into crystal report.
The scree shot below shows set by step solution:
This will bring the "Set Datasource Location dialog box.

Click on "Create Connection" > ADO.NET (XML). This will bring a new Dialog box.
Browse for the local  (not source safe) XSD file. This file should be a part of your .NET Solution.

Leave the "Class Name" and "Use Dataset from Class" blank. Click Finish.
Should have something like this.

Now select both the Tables (Child this begins with In.. in the above diagram). and click Update and Close.
In most of the case this will show the new field, try refreshing if this do not works.

No comments: