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

Optional Parameters

1 Answer 225 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 10 Mar 2009, 02:36 PM
Hi

I have created a report and created parameters. Date From, Date To, Reference
One of the parameters is a reference code which I have in a class collection and set the parameter datasource to be this.
this work fine but only allows me to select one reference at a time and the user may want to display all references.
E.g. All references between 2 dates. is this Possible?

The code below is what I use.

                //Now add the references to the reference class...  
                while (referenceReader.Read())  
                {  
                    references.Add(new References( referenceReader["Reference"].ToString()));  
                }  
 
                this.ReportParameters["Reference"].UI.AvailableValues.DataSource = references;  
                this.ReportParameters["Reference"].UI.AvailableValues.DataMember = "Reference";  
                this.ReportParameters["Reference"].UI.AvailableValues.ValueMember = "Reference";  
 


I have a function that opens the database and fills the report data into a class list as per documentation. I do the same with the reference for the parameter. This way I can get all the relevant data and close he connection to SQL down. The report then uses the data in the classes
            List<Receipts> receipts = new List<Receipts>();  
            List<References> references = new List<References>();  
 

I have also tried this using the ArrayList method. This works better in that it allows me to usse all references. The problem is you can delete them and then there appears to be now way or returning the list unless you reopen the report.

Thanks

Gary

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Mar 2009, 11:57 AM
Hi Gary,

As far as we understand, you're looking into having the ability to display all the data for a report i.e. all parameters are selected. You can use a multivalue parameter for this purpose or have no default parameter value specified in order to show unfiltered data by default.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Gary
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or