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

Bind Grouping Runtime?

6 Answers 213 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Mar 2011, 12:00 AM
I was hoping to bind the presence or not of a grouping in my report to a dropdownlist/parameter of enabled/visibility??

Is this possible?
I have read the posts about looking at the Initializecomponent code, but am unsure of what to include from this??

perhaps if i wipe the grouping then have another look?

Is it possible to have this dropdown to select grouping within the report or would it be easier to implement external as an actionlink or some such??


Similarly I am unable to get multiple columns working in this report...I've read the documentation on ensuring there are no labels etc extending beyond column width

Anything else I should be looking at??

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Mar 2011, 03:45 PM
Hello Michael,

I have attached a sample project to illustrate dynamic grouping with Report Parameters and the following grouping expression:
=IIF(Parameters.Grouping2.Value is null,"",Fields(IsNull(Parameters.Grouping2.Value, "Sales")))
Just to note that the default Sales field will not be used, it's added to avoid error while evaluating the expression.

About your second inquiry, currently multicolumn reports are supported by Silverlight, WPF and WinForms Report Viewers. The Web Report Viewer is using the HTML rendering and currently doesn't support multicolumn reports. Support for multicolumn report's is in our plans, however currently there is no time frame available. 

Regards,
Peter
the Telerik team
0
Michael
Top achievements
Rank 1
answered on 22 Mar 2011, 09:49 PM
(on multi columns)

I eventually discovered this fact, as i was typing a support ticket and was referred to a forum post (my previous searches didnt show this post). I had been following the documentation and the documentation didnt explain this...or it did, but not anywhere in the explanation of how to produce a multicolumn report.

0
Michael
Top achievements
Rank 1
answered on 22 Mar 2011, 10:29 PM
not sure how i load these files


OK added these files to my own project and i see how it's acheived....well i start to see how      :S
0
danparker276
Top achievements
Rank 2
answered on 09 Aug 2011, 06:15 PM
That will work for the grouping, but it's not going to hide the Header and footer for that group.  Visible can't be an expression.

Can I change it in the bindings?  I just want to do this
labelsGroup.Groupings.Clear();
labelsGroupHeader.Visible = false;
labelsGroupFooter.Visible = false;


I thought maybe I could do this in my change connectionString, but it isn't working:

        public static SqlDataSource ChangeConnectionString(object reportItem, int zoneNo)
        {
var report1 = (reportItem as MatterBillingFreq);
//var report1 = new MatterBillingFreq();
 var reportGroup = (report1.Groups[0] as Telerik.Reporting.Group);
 var reportGroupHeader = (report1.Items.Find("labelsGroupHeader", true)[0] as Telerik.Reporting.GroupHeaderSection);
 var reportGroupFooter = (report1.Items.Find("labelsGroupFooter", true)[0] as Telerik.Reporting.GroupFooterSection);
 
 reportGroup.Groupings.Clear();
reportGroupHeader.Visible = false;
 reportGroupFooter.Visible = false;

Is there something else I can bind?
0
Steve
Telerik team
answered on 10 Aug 2011, 02:47 PM
Hello Dan,

We're not familiar with your scenario and what you're trying to achieve, so we cannot suggest a concrete solution. However have in mind that most properties (Visible included) can be set to an expression which returns the expected type (in this case bool). You do this by utilizing Bindings.

All the best,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
danparker276
Top achievements
Rank 2
answered on 14 Aug 2011, 10:16 PM
I want to have a grouping based on a parameter setting.  If I do an IIF statement like above on my grouping clause it works fine, but I still have my header and footer for my group.  I can't set visibility as an expression.   How can I change the visability of those?  Binding would be an option too, but it doesn't seem to work for me.

EDIT:  Ok, I got it now.  You can put a binding on anything.  I just thought you could only put a binding on the main report.  Works fine now.  It would be nice if I could set it up programatically evertime I hit preview though.
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Peter
Telerik team
Michael
Top achievements
Rank 1
danparker276
Top achievements
Rank 2
Steve
Telerik team
Share this question
or