473,394 Members | 1,865 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,394 software developers and data experts.

Pass Parameter to Stored Procedure in Reporting Services

Im using sql server 2005 and visual studio 2005.
I just want to create some reports and deploy them to the local reportserver for an intranet application by using reporting services.
I'd like to use the report designer to create my reports but it seems kind of confusing with the many ways you can get into the report designer and be offered different options thru the wizards.
Heres what I can do:
I can create a generic report by using this route: (from inside the visual studio 2005 ide):
File > New Project > Report Project Wizard and then I can set the datasource to my database table.
Next, I get to the Query Builder and I dont know how to hook up my sp as the query:
For my test query, I chose a table, selected all the fields in it and dragged them onto the report form.
But, the designer seems very limited: most of the items in the toolbox are grayed out: labels, etc.
Heres my sp:
--------------------------
Select ClientId, ContactName, ContactFirstName, ContactLastName,CompanyName, Address1,Address2, City, State, Zip,
EMail,phone,Fax, Status,Description
From Client
Where ClientId = @ClientId
---------------------------------
This stored procedure takes one parameter and I would like to browse for this sp so that I can set up and pass my parameter but Im lost.
I went thru a bunch of tutorials all week and im at a dead end. It seems like it should be easier than Im making it.


What is the best way to accomplish what I want for my situation?
Thanks in Advance.
Oct 11 '07 #1
3 13547
iburyak
1,017 Expert 512MB
Try creating a view instead.

Expand|Select|Wrap|Line Numbers
  1. Create view Your_View
  2. AS
  3. Select ClientId, ContactName, ContactFirstName, ContactLastName,CompanyName, Address1,Address2, City, State, Zip,
  4. EMail,phone,Fax, Status,Description
  5. From Client
Use your view with parameter

Expand|Select|Wrap|Line Numbers
  1. Select * from Your_View Where ClientId = @ClientId
Oct 11 '07 #2
Thanks for the response-
Ive been working with this all day today.....

I tried your suggestion and it worked.

Thanks Again.
Oct 11 '07 #3
gnorro
1
I have a similar situation.
I have a web form in which I have different search fields. I wanti to do a search for some of these fields and then view a report with the search results. But I sould create the query dinamically because if I don't select a filter that field shouldn't be included in the query.

for example:
I search for field name and I don't insert anything inside surname field. the query is:
select * from users where name = @name

I search for field surname and I don't insert anything inside name field. the query is:
select * from users where surname = @surname

I search for field name and surname. the query is:
select * from users where name = @name and surname = @surname

how can i do that inside report? is it possible? If it's not possibile I need something that let me do that

thanks
Jun 24 '08 #4

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

Similar topics

2
by: Jeff Thur | last post by:
I am running a SQL Stored Procedure that will give the user a count of how many records are in the database as per certain criteria. I'm using the Execute Scalar Method. I have no problem passing...
1
by: jaya | last post by:
Hi, I am using asp.net to pass parameters from .aspx page to my Microsoft reporting service. My .aspx page has checkbox. If it is checked it the chekbox should pass value =0 to my report <INPUT...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
2
by: Raj | last post by:
How to pass a Two Date parameter to a report at runtime using VB .NET -- Raj Kumar Mishra jcast Networks Ltd. New Delhi. India. 91-51678212,13,14
2
by: Dean Slindee | last post by:
I would like to pass multiple parameters from a VB.NET application to an existing Access 2003 application's reports (essentially using Access as a report writer where the reports already exist)....
0
by: Dean Slindee | last post by:
I would like to pass multiple parameters from a VB.NET application to an existing Access 2003 application's reports (essentially using Access as a report writer where the reports already exist)....
2
by: andres | last post by:
hi all, thanks for everyone for your support! i have a report being built in studio 2005. It calls a stored procedure. The SP runs a query and gets a data set which then loops through to get...
0
by: Sehboo | last post by:
I am not sure if this is the right group, but my question is related to C#. I have a report in which the second parameter is dependent on the first one. Thru reporting services manager, I see...
12
by: ArunDhaJ | last post by:
Hi Friends, Is it possible to pass a table as a parameter to a funtion. whos function declaration would look some thing like this.... ALTER FUNCTION TempFunction (@TempTable TABLE, @nPId INT) ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.