Mahantesh,You can easily accomplish this using analyze=”true”
parameter.Basically in a querydef, you need to have the parameter:
analyze=”true”.For a field named @state, it will create attributes
@stateLabel and @stateImg.Then you can use that for your label values.
Feel free to unicast me for a sample.Arvind Jain [ cmu2010@gmail.com ]