Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Tips and Tricks
Message Icon Topic: Dynamic Sql Post Reply Post New Topic
Author Message
rajaobj
Newbie
Newbie
Avatar

Joined: 04 Aug 2008
Location: India
Online Status: Offline
Posts: 1
Quote rajaobj Replybullet Topic: Dynamic Sql
    Posted: 04 Aug 2008 at 11:18pm
Hi,
Can we use dynamic sql in crystal reports.I have written a SP using Dynamic Sql in SQLServer 2005.But when i use the SP inside the report i am not able to see the columns insted i am getting Expr1000,Expr1001,Expr1002.Any suggestions


Thanks,
Raja
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 12 Aug 2008 at 12:48pm
Crystal stores the column names in the report.  For an example of this, build a simple report with a table and then add a field to the table - it won't appear in the field explorer until you specifically validate the database.  So, if the stored procedure can return different column names in different orders, you won't be able to see the actual field names in the report designer.
 
-Dell
IP IP Logged
cobill
Newbie
Newbie


Joined: 17 Oct 2008
Location: United States
Online Status: Offline
Posts: 11
Quote cobill Replybullet Posted: 17 Oct 2008 at 10:27am

I've got a similar problem.  I'm using SQL Server 2000 and Visual Studio 2008 with it's bundled version of Crystal Reports.  I had a report populated by a stored procedure, but changed the stored procedure to use dynamic SQL (only for selection criteria, not for column names).  I can now preview the report from the .rpt tab with no errors, but when the report runs, as soon as the CR viewer loads, I get a pop-up Query Engine Error: '42S02... Invalid object name '.report_vw'  (which is prepended in code with a dynamic database name) Failed to open a rowset.  After clicking OK and putting in the parameters, the report still runs fine.  Any idea how to avoid the pop-up?  Thanks.

cobill
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.