Crystal Report의 데이터 소스로 .Net 클래스를 사용할 수 있습니다. Crystal Report를 추가하는 동안 Ad0.Net 또는 .Net Object를 요청합니다. 우리는 .Net Objects를 선택해야합니다. 프로젝트의 모든 클래스를 나열합니다. in 데이터 소스로 사용할 클래스를 선택할 수 있습니다. 클래스의 다음 속성이 나열되고 있다는 점에서 우리는 여기
이 샘플 코드이다 필요한 필드를 선택할 수 있습니다
Dy_Daywisesales_RPT myDataReport = new Dy_Daywisesales_RPT();
// This is to get the individual textobject
(myDataReport.Section2.ReportObjects["txtFromDate"] as TextObject).Text=Daywisesales.From1;
(myDataReport.Section2.ReportObjects["txtToDate"] as TextObject).Text=Daywisesales.To1;
(myDataReport.Section2.ReportObjects["txtStation"] as TextObject).Text=Daywisesales.StationName;
// This is the collection as a datasource
myDataReport.SetDataSource(Daywisesales.lstDayWiseSalesDetails);
crystalReportViewer1.ReportSource = myDataReport;
에게