Bind Grouping Runtime?

7 posts, 0 answers
  1. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 20 Mar 2011 Link to this post

    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??
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 22 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 22 Mar 2011 Link to this post

    (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.

  5. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 22 Mar 2011 Link to this post

    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
  6. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 09 Aug 2011 Link to this post

    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?
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Aug 2011 Link to this post

    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 >>

  8. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 14 Aug 2011 Link to this post

    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.
Back to Top
DevCraft banner