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

Programatically adding filters to a report

3 Answers 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
timtom
Top achievements
Rank 1
timtom asked on 07 Jun 2008, 06:32 PM
Hi :o)        

I wondered if you have any code snippets in vb on how to filter the data in a report programatically as I can't find this in the help file.

Thank you so much

Tim x

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 09 Jun 2008, 12:01 PM
Hi Tim,

Indeed we have not considered including such code in our help as we strive to help developers achieve everything through our designer. Of course in situations where this is not flexible, you can setup the filtering in design time, build and see what has our designer generated in the InitializeComponent() method. It should look something like this:

reportParameter2.UI.AvailableValues.Filters.AddRange(new Telerik.Reporting.Data.Filter[] { new Telerik.Reporting.Data.Filter("=Fields.ProductCategory", ((Telerik.Reporting.Data.FilterOperator)(Telerik.Reporting.Data.FilterOperator.Equal)), "=Parameters.ProductCategory")});

Regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
timtom
Top achievements
Rank 1
answered on 09 Jun 2008, 12:27 PM
Hi Steve :o)

Thanks for that.

Before I try that can I just check I am looking in the right place.

What I am trying to achieve is to have a webform where the user selects a date range and category. They then press print and a report is produced, based on the values selected on the webform, and displayed in the reportviewer. 

Is there a way to do this without having to write code? 


Thanx so much buddy

Tim :o)
0
Steve
Telerik team
answered on 09 Jun 2008, 12:42 PM
Hi Tim,

You've probably seen it already, but I am going to point you to it once again - see our Product Line Sales catalog, where you have two dropdowns above the report and a Preview Button that refreshes the report based on the filtering criteria the user has selected.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
timtom
Top achievements
Rank 1
Answers by
Steve
Telerik team
timtom
Top achievements
Rank 1
Share this question
or