I have a report designed with the release version of crystal reports for VS 2010. The current status is for learning/testing how to fill in what I require in the real situation.
I have a form (ReportViewer) which has a crystal report viewer on it. No report is attached to the viewer.
The following should pass a list with three items (each a date and two double values). It also passes the name of the report file I want to display in the viewer.
ReportViewer rv = new ReportViewer();
List<MonatsrapportData> lst = new List<MonatsrapportData>();
lst.Add(new MonatsrapportData(new DateTime(2010, 12, 12), 5, 3));
lst.Add(new MonatsrapportData(new DateTime(2010, 12, 13), 6.8, 3));
lst.Add(new MonatsrapportData(new DateTime(2010, 12, 14), 5, 3.9));
public class MonatsrapportData
public MonatsrapportData(DateTime dte, Double soll, Double effektiv)
dteDay = dte;
dSoll = soll;
dEffektiv = effektiv;
public DateTime dteDay;
public Double dSoll;
public Double dEffektiv;
The form that wraps the report viewer has the following functionto load the report, attach the list of items and also set a (string, static) parameter which is displayed once on the report header.
public void SetReportFile(String szRpt, List<MonatsrapportData> lst)
this.reportDoc = new ReportDocument();
String s = "Hello World";
this.crystalReportViewer1.ReportSource = this.reportDoc;
I execute the DEBUG build from Visual Studio and:
Everything runs, the report is displayed, the parameter has the correct value, three records appear in the detail section. I close the app and it exits nicely.
Without making any changes I execute the debug version again from Visual Studio and I get an error when I close the app. See picture.
Running the exe from windows explorer doesn't seem
to give any problems.
What is going on with the debug version being executed from visual studio?