473,770 Members | 4,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass Parameter to Stored Procedure in Reporting Services

3 New Member
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, ContactFirstNam e, ContactLastName ,CompanyName, Address1,Addres s2, City, State, Zip,
EMail,phone,Fax , Status,Descript ion
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 13570
iburyak
1,017 Recognized Expert Top Contributor
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
jtrapat1
3 New Member
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 New Member
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
4606
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 values that the user inputs into Text boxes to my Stored Procedure. However I have a drop down list with a listing of the individual States, which the user selects. I am trying to use the SelectedValue of the drop down list but I am getting a...
1
2206
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 id="ReviewedBy" style="WIDTH: 16px; HEIGHT: 20px" type="checkbox" name="ReviewedBy" value = 0> if the check box is unchecked it should pass value = 1. i.e. <INPUT id="ReviewedBy" style="WIDTH: 16px; HEIGHT: 20px"
7
21635
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 server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
2
2212
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
3182
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). The reports' datasource is a stored procedure with multiple @parameters. This code works where the report requires no parameter: Dim strAccessDBPath As String Dim booReturn As Boolean = False strReportName = "rptCMOTeam1" strAccessDBPath =...
0
1370
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). The reports' datasource is a stored procedure with multiple @parameters. This code works where the report requires no parameter: Dim strAccessDBPath As String Dim booReturn As Boolean = False strReportName = "rptCMOTeam1" strAccessDBPath =...
2
2625
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 other data. At the end the stored procedure cursor returns several data sets. my problem is that the report services appears to be reading only the data returned from the first loop of the cursor inside the stored procedure. It does not return the...
0
3152
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 that first dropdown box is filled with correct values, I pick one value then it calls the stored procedure and fills the second drop down box. So, everything is working fine in manager. My problem is that I am using report viewer. In report...
12
4646
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) my problem is: i have to access a temporary table created in an SP in a function
0
9439
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.