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

report parameters <select all>

5 Answers 285 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jpa
Top achievements
Rank 1
jpa asked on 14 Dec 2010, 05:09 PM
Is there a way to remove the <select all> option in a multi-value report parameter?

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Dec 2010, 02:33 PM
Hi jpa,

The Report Parameter area provides out of the box UI support for the parameters that covers 98% of the user cases and for that reason it is not customizable. In order to achieve your requirement, you should create custom UI for the parameters (for example using our RadComboBox control) and hook it up to the parameters via the Reporting API. Another option to limit the available choices is to make the parameter a Cascading Parameter.

Best wishes,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Randa
Top achievements
Rank 1
answered on 03 May 2012, 07:22 PM
I am trying to display "All" or any literal , when user does select all. Instead of all the values seperated by comma, but I would still want to display what the user selected if they did not select all.

Using version Q2 2011

I have a StatusId and Status that is in an SQL table.
The information is almost : 1  Saved 
                                            2 Approved
                                            3 Denied.
and the list is much bigger.
So when the user selects all , right now I get   Status:  Saved, Approved, Denied
I would want to display Status: All
and if the user selected only 2 and 3.
I still want to see Status: Approved, Denied.

I am using a user function to convert array to string for the Parmeters.StatusID.Label.
Here is the Report Parameter definition:

reportParameter2.AvailableValues.DataSource =

 

this.StatusDataSource;  

reportParameter2.AvailableValues.DisplayMember = "= Fields.Status";  

reportParameter2.AvailableValues.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] { 

 

new Telerik.Reporting.Data.Sorting("=Fields.Status", Telerik.Reporting.Data.SortDirection.Asc)});  

reportParameter2.AvailableValues.ValueMember = "= Fields.StatusID";  

reportParameter2.MultiValue = true;  

reportParameter2.Name = "StatusID";  

reportParameter2.Text = "Status";  

reportParameter2.Type = Telerik.Reporting.

 

ReportParameterType.Integer;

 

reportParameter2.Value = "9999"
// this initial value is taken into consideration in stored procedure to select all Status  

reportParameter2.Visible =true;


Here is the textbox I am trying to display the selected values in : 

 

// StatustextBox  

 

//  

 

this.StatustextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.100078821182251D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.42057722806930542D, Telerik.Reporting.Drawing.UnitType.Inch));  

this.StatustextBox.Name = "StatustextBox";  

this.StatustextBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.1999211311340332D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Inch));  

this.StatustextBox.Value = "= StringFunctions.ArrayToString(Parameters.StatusID.Label)";  

// This is a user function I added to convert from array of objects to string.

 


Is there a way I can do that?


0
Peter
Telerik team
answered on 07 May 2012, 07:49 AM
Hi Randa,

As explained in our previous post, the report parameters cover most of the use cases, still your scenario is more specific and in order to achieve your requirement you should create custom UI for the parameters (for example using our RadComboBox control) and hook it up to the parameters via the Reporting API. This way when the user selects 'All' you can provide only the string 'All' to the report parameter.

Greetings,
Peter
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Tarun
Top achievements
Rank 1
answered on 15 Jan 2015, 12:39 PM
Hi Peter,

I'm also having this specific requirement to display only the string 'All' to the report parameter when the user selects 'All' in multivalue parameter.

Can you please give some example to create the custom UI for the such requirement as I'm very new to the telerik? and we have got this defect from production.

Regards,
Tarun
0
Stef
Telerik team
answered on 20 Jan 2015, 09:40 AM
Hi Tarun,

To add a multivalued parameter you will have to:
  1. Create a report - How To: Create a Report (Visual Studio)
  2. Add a report parameter - Using Multivalue Parameters
  3. Display the report in a viewer, where my recommendation is to use the HTML5 Report Viewer

In general the idea to use custom UI is to have full control over the parameter's editors. For example you can use a CheckBoxList control and subscribe for its change events. On change of the selection in the control you need to pass the new values to the report, which can be done through the report source object wrapping the report.
If we assume you are using the ASP.NET ReportViewer the parameters update will look as follows:
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        var typeReportSource = new Telerik.Reporting.TypeReportSource();
        typeReportSource.TypeName = "Telerik.Reporting.Examples.CSharp.ListBoundReport, CSharp.ReportLibrary";
        ReportViewer1.ReportSource = typeReportSource;
    }
}
 
  protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
             if(ReportViewer1.ReportSource.Parameters.Contains("Parameter1")
                 ReportViewer1.ReportSource.Parameters["Parameter1"].Value= "new value";
             else
                   ReportViewer1.ReportSource.Parameters.Add("Parameter1","initial value");
        }


If you are using the HTML5 Report Viewer, please check the example in How To: Pass Values to Report Parameters.
When you use the HTML5 Report Viewer, you can also customize the report parameters editors loaded in the viewer's parameters area - How To: Create a Custom Parameter Editor. All default parameters editors are Kendo UI widgets loaded through the viewer's template files (CSS,JS and HTML).


I hope the provided information helps you.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
jpa
Top achievements
Rank 1
Answers by
Peter
Telerik team
Randa
Top achievements
Rank 1
Tarun
Top achievements
Rank 1
Stef
Telerik team
Share this question
or