May 20, 2009 at 1:42 pm
I am using this proc for my report
alter PROCEDURE counts
@year char(4)=null,
@month char (3)=null,
@server char(5)=null,
@DB varchar(10)=null
AS
BEGIN
SET NOCOUNT ON;
select Col1,Col2,datename(m, EntryDate)as Month, datepart(yy,EntryDate) as year ,
substring(plandb,1,5)as Server,substring(db,6,20) as DBname from Revcounts
Where datepart(yy,RecordDate)=@year and
datename(m, RecordDate)=@month and
substring(db,1,5)=@server and
substring(db,6,20)=@db
END
GO
please Let me what else i have to change.
I would like to populate a report with 4 drop down boxes where in upon selection it has display accordingly and if nothing is selected it has to display everything in the report without using where clause. I also created 4 datasets to bring up the drop down list.
May 20, 2009 at 3:27 pm
You would need to check the parameters for null values in the procedure and adjust your where clause accordingly. You can do this with IF statements and write individual queries after each if or you can use Dynamic SQL and build a query string and call it using sp_executesql. Check out this article for sp_executesql
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
May 26, 2009 at 9:00 pm
I have the drop down list populated in the report and also my store proc is OK with all the IF statements for parameter values. Now how would i use my proc to use in the report as when a name is selected from the drop down list it has to display result as it displays in my query window for the store proc.
May 29, 2009 at 1:42 am
Hi,
Have u created report parameters year,,month,server,DB?
If yes then pass these report parameters to ur SP in dataset n u should get the desired output.:-)
June 23, 2011 at 12:49 am
Hi,
i have set all thing related to dropdownlist. My dropdownlist contains checkboxes so what my requirement is by defualt all checkboxes shud be selected..
how to do that?
it is realy an urgent issue.
please help me
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply