如何使用C#在Crystal报表中调用存储过程

时间:2021-11-07 16:38:54

I am able to create a crystal report for a single table call from C#.\ But I have to call generic stored procedure or a single stored procedure. How can I do this?

我能够从C#为单个表调用创建一个水晶报表。\但我必须调用通用存储过程或单个存储过程。我怎样才能做到这一点?

  1. Do we can acheive this using XML files also? I mean .. the details abt which table the SP is referring to and if I want to dump the data to excel sheet, which cells the data needs to be inserted.
  2. 我们是否也可以使用XML文件来实现这一点?我的意思是...详细信息ab是SP所指的表格,以及我是否要将数据转储到Excel工作表,需要插入数据的单元格。

I have XML for my tables also. Now I hav to call stored procedure in crystal reports.

我的表也有XML。现在我要在水晶报告中调用存储过程。

Please suggest me doin this

请建议我这样做

Thank you, Ramm

谢谢你,拉姆

1 个解决方案

#1


I'm not sure that I totally understand the question so I'll answer it the best I can.

我不确定我是否完全理解这个问题,所以我会尽力回答。

Try this link to help you get started on what you are looking for. http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx

试试这个链接可以帮助您开始寻找您想要的东西。 http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx

You can report off of xml data if needed by using the XML connection in the datasources screen.

如果需要,可以使用数据源屏幕中的XML连接来报告xml数据。

Edit: If are just trying to connect the report to an sp then you should be able to do it using the OLE DB ADO connector and SQL Server provider. Once connected you should be able to navigate down to the stored procedures and add the one you want as a selected table. Then simply add the fields to the report detail section and format it so that it exports properly to Excel. Hope this helps.

编辑:如果只是尝试将报表连接到sp,那么您应该能够使用OLE DB ADO连接器和SQL Server提供程序执行此操作。连接后,您应该能够向下导航到存储过程并将所需的过程添加为选定的表。然后只需将字段添加到报表详细信息部分并对其进行格式化,以便将其正确导出到Excel。希望这可以帮助。

#1


I'm not sure that I totally understand the question so I'll answer it the best I can.

我不确定我是否完全理解这个问题,所以我会尽力回答。

Try this link to help you get started on what you are looking for. http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx

试试这个链接可以帮助您开始寻找您想要的东西。 http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx

You can report off of xml data if needed by using the XML connection in the datasources screen.

如果需要,可以使用数据源屏幕中的XML连接来报告xml数据。

Edit: If are just trying to connect the report to an sp then you should be able to do it using the OLE DB ADO connector and SQL Server provider. Once connected you should be able to navigate down to the stored procedures and add the one you want as a selected table. Then simply add the fields to the report detail section and format it so that it exports properly to Excel. Hope this helps.

编辑:如果只是尝试将报表连接到sp,那么您应该能够使用OLE DB ADO连接器和SQL Server提供程序执行此操作。连接后,您应该能够向下导航到存储过程并将所需的过程添加为选定的表。然后只需将字段添加到报表详细信息部分并对其进行格式化,以便将其正确导出到Excel。希望这可以帮助。