Print Page | Close Window

Print EXISTING Crystal Report based on stored proc

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5858
Printed Date: 02 May 2024 at 5:30pm


Topic: Print EXISTING Crystal Report based on stored proc
Posted By: Rulex
Subject: Print EXISTING Crystal Report based on stored proc
Date Posted: 23 Mar 2009 at 8:37am

Hello everybody,

My task is to run EXISTING Crystal Report from some application.  I have already working solution, which uses Crystal Report SDK, but on some reason I need to be able to run it using C#.  These EXISTING Crystal Reports are based on stored procedures and all stored procedures have one parameter.  After I add all required info (logon info, parameter info) into ReportDocument class, assign it as a source to CrystalReportViewer and run it, nothing comes out, I mean print/preview resulting in just completely white sheet of paper.  There are no complaints regarding logon info or parameter not set, just nothing comes out.  If I’m using same C# code to run the report, which is not based on stored procedure, my C#code works fine.  Running of the SQL profiler provides some info, which may give some hints for knowledgeable person J.  Here is the info I can see running the profiler:

 

Working Crystal SDK version produces the following line in SQL Profiler: (TextData columnt)

 

exec sp_someReportBasedStoredProcedure ‘paramValue’

 

If I’m calling same report from C#, I’m getting the following line in profiler:

 

exec “sp_someReportBasedStoredProcedure”

 

One can notice two major differences:

 in C# case, which is not working, the name of the stored procedure is in double quotes, and the parameter value is missing.

 

If somebody can help, but will require my code (how I’m setting logon and parameter info), I’ll be glad to provide it in my next post.

 

Thanks in advance

 




Print Page | Close Window