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

Report Sub Class Inheritance.

1 Answer 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 02 Jun 2015, 03:11 PM

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.

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 05 Jun 2015, 11:16 AM
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
Tags
General Discussions
Asked by
Darren
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or