Skip to Content
0
Nov 29, 2011 at 02:26 PM

How to create an editable previewable report?

126 Views

The Situation (the report is CrystalReports.Engine.ReportDocument):

I load the report (.Load(Template)) and set data (.SetDataSource(DataTable)). I save the report (.SaveAs or .Export). The Template does not necessary contains fields in DataTable used as datasource.

When I open the created report in "Crystal Reports 2011" the report preview is shown. When I switch to the design tab I can drag fields to the report, but when I switch to the preview again a dialog asking for ado.net xml datafile is shown and when canceled (I have no datafile) empty preview is shown. In Visual Studio 2010 (CRVS 2010?) I see the preview when I cancel the dialog and click the design and the preview again.

The Question:

Is it possible to create a report containing data with the preview working after report is edited?

Note:

I can achieve the desired behavior with external data file, but this soulution is not very convenient.