Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Adding AND funtionality to my report parameters

Author  Topic 

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 05:25:26
I use this code to allow my users to define date ranges, product types and affliate names

SELECT MIN(A.hitDate) AS minDate, D.AffiliateName, B.ProdType, COUNT(DISTINCT A.ipAddress) AS TOTAL
FROM ArchiveApplyTracking A LEFT OUTER JOIN
Configuration.dbo.Affiliates D ON A.affiliateID = D.AffiliateID LEFT OUTER JOIN
ArchiveCampaignIncoming C ON A.campaignID = C.ID LEFT OUTER JOIN
Configuration.dbo.ProductType B ON A.productTypeID = B.ProdNo
WHERE (A.hitDate >= @FromDate) AND (A.hitDate < DATEADD(Day, 1, @ToDate)) AND (A.ipAddress NOT IN
(SELECT ipAddress
FROM [Tracking].[dbo].ipTracking)) AND (B.ProdType = @ProductType) AND (B.ProdType NOT LIKE 'refused%') AND (A.deal = 1) AND
(D.AffiliateName = @AffiliateName) AND (B.ProdType NOT LIKE '%prequalify%')
GROUP BY D.AffiliateName, B.ProdType
ORDER BY D.AffiliateName

There is no problem defining the ProdType and AffiliateName parameters as dropdowns, but at the moment users can only select 1 product and 1 affiliate. How can i get set it to allow users to click say 4 affiliates and "all" products, or 3 products? etc

Does that make sense?


Thanks for any help offered

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-10-07 : 05:32:54
Check the Multi-Value box on the Report/Parameters menu - for the prompts on which you want to allow Multi-Select

Duane.
Go to Top of Page

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 05:52:10
Thanks, but am i being dumb or is it missing in my menu ????

[url]http://img219.imageshack.us/my.php?image=multi5ny.jpg[/url]
Go to Top of Page

Fletch
Starting Member

29 Posts

Posted - 2005-10-07 : 05:58:57
daveyboy - could be that you haven't upgraded to the latest (beta) release...
I think multi-value selections are one of the new features.

Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-10-07 : 06:01:40
I see..... I have recently been playing with the Yukon version (This allows you to do that).
I just looked up on my older version of RS and yip - you cant do it there :(

How about downloading the ctp version from Microsoft - work with it and wait for the release and then officially purchase it ofcourse.

Another longwinded way - which is how I did it in the past - is to develop your own front end in a web page which allows you to select multiple values and then pass these to the report as comma seperated values. As you can call the rs report by passing it all the values built up in a URL


Duane.
Go to Top of Page

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 06:43:05
Thanks guys, is it possible to install Yukon without overwriting my current SQL2000/Visual Studio setup?

Lat time i tried to install it, i lost half a day while i reinstalled everything!
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-10-07 : 07:36:19
Yes it is - I have both still running on my pc


Duane.
Go to Top of Page

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 07:50:28
Done, works liek a dream.

Thanks for the tip!
I have 1 last question, i am setting the value and the labels of my report parameters for (B.ProdType = @ProductType) and (D.AffiliateName = @AffiliateName) , but i have like 250 of them!

I have already manually typed them into VS2003, is there any way to export that data?

Or failing that have VS select all the values in that feild as the available labels???

Thanx!
Go to Top of Page

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 08:19:45
I have a csv with all the values and the labels if that can be imported somehow
Go to Top of Page

daveyboy
Starting Member

24 Posts

Posted - 2005-10-07 : 10:12:43
Lat Q, my report fails if a user selects more that 1 parameter on either ProductType or AffiliateName, must i do something here:


(B.ProdType = @ProductType)
(D.AffiliateName = @AffiliateName)




to allow for multiple values to be selected?

Thanks
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-10-07 : 17:57:31
Daveyboy, it's time to start reading about SQL queries with CSV. Here's a link to get you started.

---------------------------
EmeraldCityDomains.com
Go to Top of Page
   

- Advertisement -