简体   繁体   English

在Visual Studio 2008中没有数据源分配在Crystal报表中

[英]without data source assign in crystal report with visual studio 2008

I am studying crystal report with visual studio 2008. I knew OLEDB, ADO.Net And ADO connections etc. But whatever connection that we must assign data sources. 我正在Visual Studio 2008中研究水晶报表。我知道OLEDB,ADO.Net和ADO连接等。但是无论必须指定数据源的任何连接。 I want to non-configured and assign data sources as like data-grid. 我想取消配置并分配数据源,例如data-grid。 In the data-grid, we can configure data field name and generate data assignation in runtime. 在数据网格中,我们可以配置数据字段名称并在运行时生成数据分配。 Can I do this for report or not. 我可以这样做是否报告。 If I can this, tell me how can I do this. 如果可以的话,请告诉我该怎么做。

You can configure it in SQL with the use of a stored proc pass the values to SQL at runtime and your SQL Query in your stored proc vill pass the values in table form or you can set your datasource in VS2008 to be set to a datasource of your choice , Datatable etc. Using a stored proc all depends on your knowledge of CR though as it can get tricky in terms of changes after you have created your report. 您可以使用存储的proc在SQL中对其进行配置,然后在运行时将值传递给SQL,而存储的proc中的SQL查询将以表格形式传递值,也可以将VS2008中的数据源设置为您可以选择使用数据表,也可以选择数据表。使用存储的proc都取决于您对CR的了解,因为创建报表后,更改时会遇到一些麻烦。

Im not sure what language you are coding in but you can just work out the other code from here: 我不确定您使用的是哪种语言,但是您可以从此处计算其他代码:

http://www.codeproject.com/KB/vb/Crystal_Rpt__Connectio.aspx http://www.codeproject.com/KB/vb/Crystal_Rpt__Connectio.aspx

or something like this: 或类似这样的东西:

ReportDocument report = new ReportDocument() ;
report.Database.Tables[0].SetDataSource(employeeList );         
report.Database.Tables[1].SetDataSource(employeeSkillList );          crystalReportViewer1.ReportSource = report;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM