Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal report with SQL command Post Reply Post New Topic
Author Message
donsls
Newbie
Newbie
Avatar

Joined: 22 Oct 2008
Location: Canada
Online Status: Offline
Posts: 7
Quote donsls Replybullet Topic: Crystal report with SQL command
     Posted: 09 Dec 2009 at 7:27am
I have a crystal report that uses an SQL command and a view to display data. The SQL command has 28 tables linked and the view gives me the current logged in user in the pc (windows user). 

Everything works in Crystal as well as VS2005 code. The moment I publish the site I get the following error.

Failed to retrieve data from the database. Failed to retrieve data from the database. Error in File report1{BIA0AA0b-1234-A234-C2325A3S3S}.rpt: Failed to retrieve data from the database.

Before I display the report I do provide the active directory user and password to the report. If I run only the SQL command or only the view then everything works. The moment I link these 2 I get the above error. I even tried to impersonate and I still get the error.

If I save the SQL command as a view in SQL database and then add both views and link them, they run without any issues.

I just can't seem to get this work with a dynamuic SQL command. Could some one help me with this. I have been working on this for too long and I have no idea how to solve this. Creating a view in the SQL server for the SQL command is not an option, as we do create many reports with different SQL commands.

Any help is greatly appreciated. Please help.



Edited by donsls - 09 Dec 2009 at 7:28am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 09 Dec 2009 at 2:41pm
I am only guessing, but how big (# of characters) is this SQL command.  I do not know what the character limit is for Crystal, but you may have exceeeded it.  Also I know that some drivers choke if you try to link too many table.  A stored procedure or view is the only around that issue.
IP IP Logged
donsls
Newbie
Newbie
Avatar

Joined: 22 Oct 2008
Location: Canada
Online Status: Offline
Posts: 7
Quote donsls Replybullet Posted: 04 Jan 2010 at 7:24am
SQL command has over 1000 characters.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum