Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Crystal Reports与C#对象一起使用_C#_List_Crystal Reports - Fatal编程技术网

将Crystal Reports与C#对象一起使用

将Crystal Reports与C#对象一起使用,c#,list,crystal-reports,C#,List,Crystal Reports,我不熟悉水晶报告。我需要生成报表,但无法访问数据源。需要使用包含数据列表的.Net类填充报告。我怎样才能做到这一点。我在Google上搜索了一天的大部分时间,但只能找到使用SQL或ADO.NET数据源的示例。如何使用C#中带有列表的类对象来实现这一点 亲切的问候 Mateen报告需要一个数据源。您可以将.Net类中的数据列表序列化为XML文件、逗号分隔文件或crystal reports可以连接并使用的某种数据结构 我认为您不能直接连接到.Net类并对其进行“报告”。报告需要数据源。您可以将.N

我不熟悉水晶报告。我需要生成报表,但无法访问数据源。需要使用包含数据列表的.Net类填充报告。我怎样才能做到这一点。我在Google上搜索了一天的大部分时间,但只能找到使用SQL或ADO.NET数据源的示例。如何使用C#中带有列表的类对象来实现这一点

亲切的问候


Mateen报告需要一个数据源。您可以将.Net类中的数据列表序列化为XML文件、逗号分隔文件或crystal reports可以连接并使用的某种数据结构


我认为您不能直接连接到.Net类并对其进行“报告”。

报告需要数据源。您可以将.Net类中的数据列表序列化为XML文件、逗号分隔文件或crystal reports可以连接并使用的某种数据结构


我认为您不能直接连接到.Net类并对其进行“报告”。

我们可以使用.Net类作为Crystal report的数据源 在添加Crystal Report时,它将请求Ad0.Net或.Net对象。 因为我们必须选择.Net对象。 它将列出项目中的所有类。 这样,我们就可以选择要将其用作数据源的类。 然后将列出该类的属性,在其中我们可以选择必要的字段

以下是示例代码:

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;

我们可以使用.Net类作为Crystal Report的数据源 在添加Crystal Report时,它将请求Ad0.Net或.Net对象。 因为我们必须选择.Net对象。 它将列出项目中的所有类。 这样,我们就可以选择要将其用作数据源的类。 然后将列出该类的属性,在其中我们可以选择必要的字段

以下是示例代码:

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;