views:

1239

answers:

4

The default value for the first item in a drop down list is the name of the database field. I need to change it to a more user friendly name. How do I change the value?

+2  A: 

add a HTML Item onto the prompt page and add the following as an HTML item:

Example: <script> document.formWarpRequest._oLstChoicesMyList[0].text = '--SELECT A CITY--'; </script>

Replace 'MyList' with the name of the component.

from: link text

Joshua
+2  A: 

You have a couple of options. First, you can rename the data item's name from database field name to a more friendly name in the Framework Manager metadata.

Second, you can rename the item in Report Studio. However, if you do this you will notice that it is still using the database name. You actually need to perform a calculation in the item expression for it to use your name instead of the default name. So say you are pulling in the string field [Namespace].[Unfriendly Name] and you named your report data item "Friendly Name." The top selection will still read "Unfriendly Name." However, if you replace the data item with the following:

[Namespace].[Unfriendly Name] || ''

It will see that there is a calculation involved and use your friendly name. In the case of a number field you have to add zero instead of concatenating ''.

This is also the case with report column headers (which you can replace with text instead of using this calculation method).

Convoluted? Yes.

Richard Cresswell
A: 

Within the dataitem in the query.. you could do a ..

IF ( [dataitemA] = 'some text' ) THEN ( 'new text' ) ELSE ( [dataitemA] )

i try to avoid using javascript and html items becuase they dont generally work in pdf or excel outputs.

just a thought..

cheers!

Kirby
A: 

Kirby,

Could you please give a little more steps on using your solution? I have to do something similar and can't figure this out.

eg. where is this dataitem in the query - how do I navigate to the query?

Thank you, SC