Crystal Reports - Failed to open a rowset

2019-04-20 02:58发布

What can be done to resolve the exception:

CrystalDecisions.CrystalReports.Engine.InternalException: Failed to open a rowset.

12条回答
再贱就再见
2楼-- · 2019-04-20 03:48

Check Changing Crystal Report Database logon information at runtime in VS2005 for help.

Important line in it is:

table.Location = Database & ".dbo." & table.Name
查看更多
啃猪蹄的小仙女
3楼-- · 2019-04-20 03:50

This is caused by some discrepancy in your relations, like opposite left joins or something similar. CR has also the bad habit to create 'default' links each time you modify the list of tables and views needed for the report. It can even sometimes automatically create recursive links that might not be viewable 'at once' in the relations screen.

If you cannot find which relation(s) is causing the trouble (sometimes it is not so obvious), you'll have to make some trial & errors test by adding/removing tables from your report.

查看更多
欢心
4楼-- · 2019-04-20 03:53

As said this is a generic error, and like all such errors it's a very frustrating one. The problem is that VS 2003 has no preview option for crystal reports so it's hard to track down the source of the problem. So best way to solve this is to create a blank project in vs 2005 or later, import the crystal report, and run preview. You will get a more specific error then.

查看更多
Root(大扎)
5楼-- · 2019-04-20 03:53

In your store procedure If you are using

SET NOCOUNT ON;

Then just remove this

--SET NOCOUNT ON;

Now verify your report database, build & run your solution.

查看更多
6楼-- · 2019-04-20 03:57

This is a generic error in Crystal Reports whenever the report query fails. There can be a number of causes. If your report was targeted to a specific database and then the database was changed without updated the report, this can cause it. It can also be caused by something in the query itself failing, such as if the report is based on a stored procedure that doesn't exist on the database against which the report is running. Try verifying the database for the report.

查看更多
Fickle 薄情
7楼-- · 2019-04-20 04:01

I had this problem - we use SQL logins for our security (not integrated / DSN connections)

By granting execute permissions to the user for my stored procedure I fixed the problem.

Really, really couldn't hate Crystal more for their exception masking - let this be a lesson to all programmers;

Try
   'your code here
Catch
   Throw new exception("Hey, here's a really friendly but completely useless error message")
End Try

will result in pain for future developers - DON'T DO IT!

查看更多
登录 后发表回答