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

Grouping at runtime

1 Answer 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 02 Oct 2007, 01:51 PM

    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.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 04 Oct 2007, 04:12 PM
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
General Discussions
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Telerik team
Share this question