473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how can i create a crystal report using stored procedure

Hi friends ,


I want to create a Crystal report in C# using Parameterised Storred Procedure

This is my Stored Procedure
ALTER proc [dbo].[sp_employeReport]
(
@fname varchar(50),
@lname varchar(50),
@team varchar(50),
@rep varchar(50),
@status int,
@level varchar
)
As
Begin

Declare @Sql Varchar(8000)
set @Sql=' SELECT StaffId,FirstName,LastName,TeamName,LevelName,Empl oyee.Status from team,levels,leveldetails,Employee Where Levels.levelId=Leveldetails.levelId and Employee.StaffId=LevelDetails.Employeid and Team.TeamId=LevelDetails.TeamId '

If @fname <>''
Set @Sql = @Sql +' And FirstName like ''' + @fname +'%'''
If @lname <>''
Set @Sql = @Sql +' And LastName like ''' + @lname +'%'''
if @team<>0
set @Sql=@Sql+' And Team.TeamID = '''+ @team + ''''
if @rep<>0
set @sql=@sql+' And RepOfficer ='''+@rep+''''

If @status <>2
Set @Sql = @Sql +'And employee.Status =''' + Ltrim(@status)+''''
if @level<>0
Set @Sql = @Sql +'And levels.levelid =' + @level


Exec(@Sql)
PRint(@Sql)
End

I passed 5 parameters . How can i create a cristal report using this stored procedure and pass parameters to it
Thanking u & Regards
Balu
Mar 12 '08 #1
0 1113

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
1
by: snoopy13 | last post by:
I am using crystal report.NET in my asp.net application. I have a report calling a stored procedure from SQL Server 2000. Whenever I am using temp tables in the stored procedure, I am getting...
1
by: Joe | last post by:
Hi friends, I need dynamically generate the crystal line graph from the c# application. i used stored procedure.but i don't know how to connect the C#, stored procedure and crystal report. 1....
2
by: Craig in Boulder | last post by:
I have been trying for over a week to get data from my stored procedure into a Crystal Report in VS.NET 2003 with no luck. I have all sorts of code parts but nothing that tell me how then go...
0
by: Craig Faulkner | last post by:
I have been fighting through my first crystal report in VS2003.NET and have made some headway. Here is what I've done: 1. Created a crystal report in VS2003 from a SQL stored procedure with...
0
by: mmccor | last post by:
Hi. I'm having a problem passing a value to a sql stored procedure parameter in a crystal report. When I run a trace on Sql Server the parameters are empty or null. The procedure contains one...
3
by: Diggler | last post by:
I was working on a report that is populated with three different tables in a strongly-typed dataset. The tables are populated from custom objects rather than directly from SQL Server. I loop...
0
by: Big George | last post by:
I'm developing with ASP.NET, VS.NET 2003. Using Crystal Report for VS.NET DataBase: Oracle 10g I store a BLOB field in a table. This field store images, like jpg files. The Stored Procedure...
7
by: Jlo | last post by:
Hi, I have a c# winforms application. When I call the report file, it shows me all the records in the table. How can I make it to call only a particular range. i have the following code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.