Stored Procedure not showing fields in Crystal reports

前端 未结 3 2094
猫巷女王i
猫巷女王i 2021-01-23 01:28

Using: CR in VS2010, SQL Server 2008R2

I have a SP that returns results when run in SQL Server, but when I add this to a CR it doesnt show any fields in the Field

3条回答
  •  滥情空心
    2021-01-23 01:51

    HOW TO update the Stored Procedure in Crystal Report after altering the Stored procedure in the database.

    This procedure can also be used when you have added a parameter to the Stored Procedure in the database.

    1. Make sure your SP returns a dataset not via another SP inside your SP.

      ex. this will not work: @sql = 'select * from sometable' exec(@sql)

      If this is the case, temporarily add a select statement at the end of your SP

      @sql = 'select column1, column2 from table1' exec(@sql)

      select column1, column2 from table1

    2. In Crystal Report, Fields Explorer, right click your SP and Set DataSource Location. Fill in the connection details to the DB.

      • select your the existing SP and the SP from the new DB connection, then click the Update button.
    3. In CR menu, Database->Verify Database

    4. After Database has been verified, remove the temporary select statement from Step1.

提交回复
热议问题