Report Sub Class Inheritance.

2 posts, 0 answers
  1. Darren
    Darren avatar
    1 posts
    Member since:
    Oct 2014

    Posted 02 Jun 2015 Link to this post

    I have three levels of classes to create a large number or reports.

     A. Base Class - Contains page header and footer information (company name, pages, etc)

     B. "Group Class" - Here I want to put Column headings text boxes and detail lines text boxes.

     C. "Data Class" - Here I want to put the code to pull the data and assign values to the column header text boxes and detail line text boxes in Class B above.

     

    Question:  Lets say the header and detail box for column1 in my report is going to be Employee Number on my new report (of class C).  How, in class C code, can I assign literal constants to the header text box and a data table column to the first detail box?

     

    I am trying to create a Class B where I have maybe 8-10 columns that I can always use the same layout while changing the data on the report in each instance of Class C.  I hope I made this clear enough, ugh.

     

     

     

     

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 05 Jun 2015 Link to this post

    Hi Darren,

    If the described scenario includes inheritance of types inheriting from Telerik.Reporting.Reports, each inheriting type will have access to the items collection of the inherited class, and you will be able to modify the inherited parts in the report's constructor.

    For example let assume textBox1 is in Report1, and Report2 inherits Report1. then in Report2 you can modify textBox1 as follows:
    public partial class Report2 : Report1
       {
           public Report2()
           {
               //
               // Required for telerik Reporting designer support
               //
               InitializeComponent();
               (this.Items.Find("textBox1", true)[0] as Telerik.Reporting.TextBox).Value = "new value";
           }
       }


    The special settings for applying inheritance between reports are discussed in the Report Inheritance forum thread.

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top