This is a migrated thread and some comments may be shown as answers.

Report Parameters - AvailableValues - DisplayMember/ValueMember - ValueMember not appearing in dropdown

3 Answers 218 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 25 Jul 2013, 06:36 AM
Hi there,

I have created a new report in the report designer and added report parameters.  See attached file '1-report_parameters.png' to see how I setup report parameters.
I have the report embedded in an MVC4 project using the report viewer.

What I am trying to do is get a handle of the ValueMember (ie. Field.fldBranchID) from client-side, but when I look at the html source, I see the following:

 

<td id="parameterEditorBranchID_ECell1" style="height: 1px;" unselectable="on"><div id="parameterEditorBranchID_valueEditorBranchID">
 
 <select name="parameterEditorBranchID$valueEditorBranchID$ddl1" class="ParameterEditor" id="parameterEditorBranchID_valueEditorBranchID_ddl1">
 
 <option selected="selected" value="TelerikReportingSelectAValueItemValue"><select a value></option>
 
 <option value="Croydon">Croydon</option>
 
 <option value="Dandenong">Dandenong</option>
 
 <option value="Epping">Epping</option>
 
 <option value="Geelong">Geelong</option>
 
 <option value="Hallam">Hallam</option>
 
 <option value="Hastings">Hastings</option>
 
 <option value="Laverton">Laverton</option>
 
 <option value="Mt Evelyn">Mt Evelyn</option>
 
 <option value="North Melbourne">North Melbourne</option>
 
 <option value="Oakleigh">Oakleigh</option>
 
 <option value="Phillip Island">Phillip Island</option>
 
 <option value="Rowville">Rowville</option>
 
 <option value="Taylors Lakes">Taylors Lakes</option>
  
 </select>
 
 </div><script type="text/javascript">
 
 var parameterEditorBranchID_valueEditorBranchID = new SingleAvailableValuesEditor('parameterEditorBranchID_valueEditorBranchID_ddl1');
 
 </script></td>


As you can see, the DisplayMember is listed for both the text and the value.  I would have expected to see the fldBranchID in the option value.

Can you tell me if this is by design and how I can go about getting the fldBranchID from the client-side if not through this method?

Regards,
CH

 

 

 

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 29 Jul 2013, 12:51 PM
Hi Chris,

When the dropdown is rendered, only the display information is needed and this is why we set only text to the list items (and not the value). The html that you inspect is the standard way that the ListItem is rendered under these conditions. 
 

Regards,
Elian
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Chris
Top achievements
Rank 1
answered on 29 Jul 2013, 10:51 PM
Hi,

I understand this is the method that the grid uses, what I am after is how to get the "proper" ValueMember that I have set in the report parameters instead of the DisplayMember. 
Seeing as though this is an MVC application, I am using the reportviewer as per here:
http://blogs.telerik.com/careypayette/posts/13-03-26/telerik-reporting-in-mvc-sure-it-takes-8-quick-steps-

So the only access I have to report parameters is either via the limited events in the report:
ie. ItemDataBound / NeedDataSource
or client-side.

The events are not much good because the report seems to refresh itself each time from the ".axd" file, thus not doing a return trip to the server.

I know the ValueMember is accessible because I can display "Parameters.BranchID.Value" in the report body.  When I click the "Preview" button and the report refreshes, I can see that the content must be coming out of the ".axd" file.

So the question remains, how can I get the ValueMember from the report parameter?

Regards,
Chris
0
Elian
Telerik team
answered on 01 Aug 2013, 12:36 PM
Hello Chris,

We haven't provided a way to read the parameter values on the client side. 
The only suggestion that we can give you, at the current point, is to create your own custom parameters area. This will allow you to load and use the parameters at your convenience. 

Regards,
Elian
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Elian
Telerik team
Chris
Top achievements
Rank 1
Share this question
or