cancel
Showing results for 
Search instead for 
Did you mean: 

Preview and DataSets

Former Member
0 Kudos

I have been using Crystal Reports 2008 Basic that comes with Visual Studio 2008 and have successfully been building reports. However due to the functionality restrictions in the Basic version I have decided to trial the full version. My main issue has been difficulties with formatting, particularly with charts and legend text.

I gather with the full CR 2008 version I can change the legend text when in preview mode. However I'm having trouble using Preview mode when I have ADO.NET DataSet's as my datasource. I created an .XSD file in Visual studio to define a single table dataset schema and have designed my report around this XSD file. At runtime I populate a dataset and pass that to the CR Viewer using the SetDataSource property. All this works great. However I'm not sure what I should be doing in the designer to successfully get the Preview functionality to work. If I point my connection to the XSD file, preview returns a blank screen which is understandable as its just a schema file. Clicking use DataSet from Class seems to do nothing other than display an empty combo box. How do I get this to preview? I dont seem to have this hassle with the integrated VS designer, preview works well by just displaying dummy data in the abscence of real data. However I can't change the legend text using this designer. Can anybody help?

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

Former Member
0 Kudos

The SetDataSource() method does not seem to work whether you use any of the suggested arguments in Visual Studio 2008.

I have tested both the 1.1 and 2.0 versions of the CrystalDecisions.

Is there a workaround for this?

former_member203619
Contributor
0 Kudos

Hi Mark,

What you can do is save the dataset off as a combined XSD and XML file. What you do is once you have retrieved the dataset in your code, just call myDataset.writeXML("MyFilePath.xml, XMLWriteMode.WriteSchema)

This will save off an XML file that contains both the data and the XSD in it which you can then use in the report designer.

Regards,

Shawn

Former Member
0 Kudos

Perfect, thank you. In the medium to long term I'd like to get away from datasets and instead use objects and collections. In that scenario would you happen to know how I would get a preview working in the designer?

Many Thanks,

Mark