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

Turn Report Parameter list of data into a DropDown

1 Answer 1198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 23 Jan 2020, 10:55 PM

 

Hello,

I wanted to know how to set the parameters datasource list to appear as a dropdown and not the way they are showing in the attached image. I don't see any kind of option to make it a dropdownlist as I thought this was default behavior.

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 28 Jan 2020, 08:11 AM

Hello Marcus,

In the Html5 Viewer you may set the option parameters -> editors ->singleSelect and multiSelect to "COMBO_BOX" - check Report Viewer Initialization for more details. The default mode is "LIST_VIEW". Here is sample code:

$("#reportViewer1").telerik_ReportViewer({
	...
     parameters: {
         editors: {
             singleSelect: telerikReportViewer.ParameterEditorTypes.COMBO_BOX,
             multiSelect: telerikReportViewer.ParameterEditorTypes.COMBO_BOX
         }
     },
    ...
});

Regards,
Todor
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Krunal
Top achievements
Rank 1
Iron
Iron
commented on 30 Jan 2025, 11:46 AM

I'm trying to show comboboxes instead of list using following lines of code but it seems to be not working. It keeps showing me the listbox only.

this.viewer = $('#reportViewer')
      .telerik_ReportViewer({
        serviceUrl: `${environment.apiUrl}/reportdesigner/`,
        reportSource: {
          report: `${reportName}`,
          parameters: {
            editors: {
              singleSelect: 'COMBO_BOX',
              multiSelect: 'COMBO_BOX',
            },
          },
        },
        parametersAreaVisible: true,
        parametersAreaPosition: 'TOP',
      })
      .data('telerik_ReportViewer');

Any help on this?
Dimitar
Telerik team
commented on 04 Feb 2025, 09:53 AM

The issue is that the code for changing the editors is put inside the reportSource property, the code should instead be at the top level, for example:

this.viewer = $('#reportViewer')
      .telerik_ReportViewer({
        serviceUrl: `${environment.apiUrl}/reportdesigner/`,
        reportSource: {
          report: `${reportName}`,
        },
         parameters: {
           editors: {
             singleSelect: 'COMBO_BOX',
             multiSelect: 'COMBO_BOX',
           },
         },
        parametersAreaVisible: true,
        parametersAreaPosition: 'TOP',
      })
      .data('telerik_ReportViewer');

Please try changing it as the example above and let us know if that helps.

Krunal
Top achievements
Rank 1
Iron
Iron
commented on 04 Feb 2025, 12:49 PM

@Dimitar Thanks for your reply. I managed to figure this out myself somehow but in hard way and after spending some time 
Tags
General Discussions
Asked by
Marcus
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or