Changing the base report

Top  Previous  Next

Let us look what happens if we change the base report. We can:

 

delete the object from the base report. This object will be deleted from the inherited report as well;
add the object into the base report. This object will appear automatically in the inherited report;
change the size, location, text, appearance of the object. All changes will be reflected in the inherited report, in case where this object was not changed in the inherited report.

 

The last point requires some explanations. Let us look at two examples of using inheritance. In the first example, we will do the following:

 

create a base report which contains the Text1 object;
create an inherited report and just save it, without changing anything;
open the base report and move the Text1 object;
open the inherited report and we will see that the Text1 object is moved as well.

 

In the second example, we will do the following:

 

create a base report which contains the Text1 object;
create an inherited report;
in the inherited report, move the Text1 object to a new position and save the report;
open the base report and move the Text1 object to different position;
open the inherited report and we will see that the Text1 object is not moved.

 

It happens because we have changed the object in the inherited report. This change was saved in the inherited report file. Now, if we change the original object in the base report, it will be ignored in the inherited report. In this case, the new object's location will be ignored. All other changes (such as text color, for example) will still be reflected in the inherited report.

 

This behavior will become clear if we look at the contents of inherited report file. For example, this is how the original object is saved in the inherited report, in case this object was not changed:

 

<inherited Name="Text1"/>

 

If we change the object's location in the inherited report, it will be saved like this:

 

<inherited Name="Text1" Left="255.15" Top="28.35"/>

 

When opening the inherited report, FastReport will load all object's properties, defined in the base report, plus properties, saved in the inherited report.