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
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Couple of Issues with parameters

Author  Topic 

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 09:38:07
I have a parameter called Parameters!Company.Value which works fine.

When i drag this parameter onto my report it shows #Error on the text box
The expression is =Parameters!Company.Value

Do i need to maybe change the datatype or something. How do i get it to display the company name.

The reason why i want to see this value is, because i have a separate datasource, which i have written the following query

SELECT DISTINCT Company_Name, ImageData
FROM Company_images
WHERE (Company = @Company)

When i execute this query and type in the company i get the correct results but when i preview the report, it doesnt display anything. I am thinking it may have something to do with reading of the parameter. So how do i fix this


rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-08-21 : 11:23:24
where's the list of companies coming from?
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 11:32:15
I really appreciate your help. Im really confusing myself and stuck.

The companys parameter is coming from a cube.

The images are coming from a separate datasource straight from the database.

Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-08-21 : 11:36:58
my question was, how is the company parameter being passed? is it a drop down or a text field?
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 11:40:03
Oh im sorry. It is currently a drop down. If i drag it across to be a text field it says #Error in the preview. This is the expression in the text field.
=Parameters!Company.Value
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 11:47:14
If i change the text field to read =Parameters!Company.Value(0) it displays [Company].&[ABC] in the field.

How do i get it to just say ABC (because that is what it is displayed in the dataset2
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-08-21 : 11:59:31
and is company a Multi-value parameter?
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 12:05:50
Yes
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-08-21 : 12:23:53
instead of
=Parameters!Company.Value

use
=Join(Parameters!Company.Label, ", ")
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-08-21 : 12:26:30
No, no worries i think i have got it.

Basically i had to change the expression in dataset2 to read the following, so it would extract the portion we needed only

=Mid(Parameters!Company.Value(0),7,Len(Parameters!Company.Value(0))-7)

Thank you for your help. Very much appreciated
Go to Top of Page
   

- Advertisement -