Hello All,
Can anyone please help in resolving crystal reports.Net and SQL Server stored procedure problem I am facing these days.
See here what I am having.
- We are using SQL Server 2000 stored procedures for our MIS type reports. Procedures have too complicated structure. I have given only a simple of procedure in which I face problem.
- After that, I design crystal report linked with a stored procedure using Crystal Reports 10 editor. It runs very well and shows proper data in preview mode of crystal reports editor.
- Now I called this report in my ASP.Net crystal report viewer. Also, I have set logon info and other tables related functionalities required in .
vb file.
Problem:
I m just giving sample of procedure, actually my original procedures are too complicated. But I m sure if this sample works than I will make everyone working.
If I write following procedure, it works fine on both the sides (crystal report editor and asp.Net view). So, there is no problem at all.
CREATE PROCEDURE [dbo].[temp]
(@case_type_id varchar(5))
AS
select * from ms_case_type where case_type_id > @case_type_id
GO
But now, if I write the same procedure using exec(â â + â â) method, it works on crystal report editor preview mode side but gives an error in asp.net side.
CREATE PROCEDURE [dbo].[temp1]
(@case_type_id varchar(5))
AS
exec('select * from ms_case_type where case_type_id > ' + @case_type_id )
GO
See, it is strongly required that I use second type of procedure. So, donât tell me that you canât use this way. Also, for you information, I have used 50 such procedures in our ASP project, it works well. Also it works very well if I attached it with data adaptor, it can fetch data and show using dataset or datareader in ASP.Net. So, there is nothing wrong on database side or procedure side.
The error I get is
-------------------
Exception of type System.Exception was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: Exception of type System.Exception was thrown.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Exception: Exception of type System.Exception was thrown.]
CrystalDecisions.Web.ReportAgent.u(Boolean
--------------------------------------------------------------------------------
N) +358
CrystalDecisions.Web.CrystalReportViewer.OnP reRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInte rnal() +62
System.Web.UI.Control.PreRenderRecursiveInte rnal() +125
System.Web.UI.Control.PreRenderRecursiveInte rnal() +125
System.Web.UI.Page.ProcessRequestMain() +1489
-------------------
Plz help me out if u have any solution or clue to the solution.
Thanx in advance
Jainesh