Grouping at runtime

2 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 02 Oct 2007 Link to this post


        1. I want to add groups dynamically at runtime.
            I found one example in forum for adding textbox at  runtime
             which was as follows :
            Dim columnlist As Telerik.Reporting.ReportItemBase()
             = New ReportItemBase(colcnt) {}
             Dim textBox As Telerik.Reporting.TextBox = DirectCast(columnlist
             (i), TextBox)
            I have used the similar thing for grouping as :

        Dim grouplist As Telerik.Reporting.ReportItemBase() = New 
                        ReportItemBase(colcnt) {}
        Dim group1 As Telerik.Reporting.Group = DirectCast(grouplist
                (groupi), Group)

    However I getting the error as: "Telerik.Reporting.ReportItemBase() cannot be converted into Telerik.Reporting.Group"
    I tried all the combinations but could not get the desired output.
    What should I use in place of ReportItemBase? If possible please give me an example of creating groups at runtime.

    2. As we can fix the  height of a particular section can we set the width as well?
        Right now the width for each section(header,detail etc)  is getting adjusted according to the number of  textbox it holds.
        I am applying different color for different sections. Due to which the difference of width between each section is easily getting noticed.

  2. Svetoslav
    Svetoslav avatar
    649 posts

    Posted 04 Oct 2007 Link to this post

    Hello Rahul,

    It is not possible to convert Telerik.Reportign.ReportItemBase-array to Telerik.Reporting.Group-array (or Telerik.Reporting.Group single object) because Groups are not ReportItemBase. The best place to look for examples how to build a report dynamically is the InitializComponent() methods of all sample reports and the API documentation where you can find the Report Object Model hierarchy.

    Regarding the width of a section. Sections are logical items that divide the report vertically and as such they are as wide as the report is and you can set only its height. To set the width of a report you should use the Telerik.Reporting.Report.Width property.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top