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

Sorting on text parameters

1 Answer 247 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt Thrower
Top achievements
Rank 1
Matt Thrower asked on 19 Nov 2008, 11:14 AM
Hi,

I'm trying to add a UI element to my report allowing users to select columns in the report to use for sorting.

Following the documentation I have successfully enabled the Parameters area in the report and a drop-down box duly appears containing the expected values. However, on first rendering the report a red circle appears next to the drop-down saying "invalid value" and no data appears in the report. First question is: how can I ensure unsorted values appear by default in the report as it loads?

More confusingly, although the report will successfully "preview" once a sort field has been selected, no sorting actually seems to occur. I've been messing around with the sort property of the report and I can't seem to get the syntax right to enable sorting. What I want to happen is for the ValueMember of the drop-down box DataSource to become the field used for sorting the data (the strings are identical) .. how can I achieve this?

(It's probably worth mentioning that some of the field names contain spaces, and the syntax I need for this is also confusing me ... is it Fields.fieldname with space or "Fields.fieldname with space" or Fields.[fieldname with space] or something else?)

Is there any way of getting a parameter from an external object - say a querystring on the page containing the ReportViewer and the passing it down to the report that the viewer is loading?

Cheers,
Matt

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Nov 2008, 04:18 PM
Hi Matt,

I've prepared a blog post on the matter, as probably this is going to be helpful for other community users. The post is available here: Using Report parameters UI to sort by column.
As for your other question - find attached a sample app that shows you how to use querystring to set the parameter value of a Report.

Give it a spin and let me know if further help is needed.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Matt Thrower
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or