<< Click to Display Table of Contents >> Adapt Layout |
In this chapter we describe how you adapt your own report configuration to show the version and revision in the layout.
Look how it is done
First we have a look at where the layout get its version and revision information.
We use the existing report configuration report "PID Valvelist" and click on "Edit query...".
Next we click on "Test query result".
At the end we see 4 empty columns. They will get data when you later create a version or revision.
ACP_VersionType1 and 2 will contain either a "V" or a "R" for Version or Revision.
ACP_VersionNumber1 and 2 will contain the version or revision value.
If you create just a version or revision only ACP_VersionType1 and ACP_VersionNumber1 will be filled out.
if you compare two versions or revisions then ACP_VersionType1 and ACP_VersionNumber1 will contain the info from the old version/revision and ACP_VersionType2 and ACP_VersionNumber2 will contain the newer version/revision.
Now we have a look at the layout of this report configuration. Click on "Edit report layout..." to enter the Report Designer.
You see to so called labels. The first one will later contains either the texts "Version", "Revision", or "Comparison".
The other label will later contain either the version or revision value or a text with the two version/revision values.
The two labels have calculated fields.
Make a right-click on "ACP_VersionLabel" and select "Edit Expression...".
The Expression Editor opens and shows the expression used to "calculate" the text for the first label.
If you format the expression it is easier to read.
The first line checks if "ACP_VersionType2" is empty. If this isn't the case the text "Comparison" will be returned and later shown in the report. Because, if ACP_VersionType2 is not empty it is a comparison report.
If ACP_VersionType2 is empty, the second line checks if ACP_VersionType1 is empty. If this is the case, nothing will be returned '' (line 3). In this case there is no version or revision selected. This either happens if the version/revision report isn't activated or you select "Create without versioning".
If ACP_VersionType1 is not empty, line 4 check if ACP_VersionType1 = "V". If this is the case, then you are about to create a Version. Otherwise you create a Revision.
Lets have a look at "ACP_VersionText".
This expression is a bit longer, but has a similar structure.
Line 1 checks if ACP_VersionType2 is empty. If this is the case, then it is not a comparison.
Line 2 checks if ACP_VersionType1 is empty. If this is also the case, the no version or revision is created (line 3). If ACP_VersionType1 is not empty, the value of ACP_VersionNumber1 is returned which either contains the version value or the revision value (line 4).
Line 6-16 concatenate the string if it is a comparison report.
Line 6 checks if ACP_VersionType1="V". If this is the case, the text is "Ver: ". Otherwise it is "Rev: ".
Line 12 checks if ACP_VersionType2="V". If this is the case, the text is "Ver: ". Otherwise it is "Rev: ".
The concatenated string may be: "Ver: 4 vs. Rev: B".
Be aware, that the 4 columns from the query will only be filled out when you later create the report. It is not shown in preview.
Adapt the Layout
To adapt your own report layout, the easiest way is to start PlantReporter twice and open the "PID Valvelist" in one Report Designer and your own "New Valve List" in the second PlantReporter.
First we need to create some space in the header band (or where ever you want the info to appear). Just move your mouse pointer to the band below the band where you want to create some space.
After you moved it down you now have some space.
Select the two labels from the original report layout and use copy.
Then you make sure that the band in which you want to paste the label in is active.
It is likely, that the labels will be copied at a position where you don't want them.
Just select them and drag and drop them where you want them to appear later.
For example like this.
Now we need the two calculated fields.
make a right-click somewhere in the "Field List" panel in your own report layout and select "Edit Calculated Fields...".
The following dialog will show up.
Click twice on the Add button.
Select the first items and click in "Name".
Type in ACP_VersionLabel.
Go to the original layout and use "Edit Expression...".
Copy the expression.
Go back to your layout and click on the "..." button.
The Expression Editor opens.
Paste the expression in it and click OK.
You see the beginning of the expression in the dialog.
Repeat this with the second expression from "ACP_VersionText".
Close the Report Designer and make sure you save the changes.
Test new Layout
Now create a new version of your report configuration.
We don't see the version in the file name yet. This will be explained in the next chapter Adapt Target.
However, we see the text and value in the report now.
If you create a revision...
... you see that as well.
Next Chapter: Adapt Target