Adapt Layout

<< Click to Display Table of Contents >>

Navigation:  PlantReporter > How to use > PlantReporter > Create Version/Revision >

Adapt Layout

Previous pageReturn to chapter overviewNext page

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...".

PR Create Version Revision 018

Next we click on "Test query result".

PR Create Version Revision 019

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.

PR Create Version Revision 020

Now we have a look at the layout of this report configuration. Click on "Edit report layout..." to enter the Report Designer.

PR Create Version Revision 009

You see to so called labels. The first one will later contains either the texts "Version", "Revision", or "Comparison".

PR Create Version Revision 010

The other label will later contain either the version or revision value or a text with the two version/revision values.

PR Create Version Revision 011

The two labels have calculated fields.

Make a right-click on "ACP_VersionLabel" and select "Edit Expression...".

PR Create Version Revision 012

The Expression Editor opens and shows the expression used to "calculate" the text for the first label.

PR Create Version Revision 013

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.

PR Create Version Revision 014

Lets have a look at "ACP_VersionText".

PR Create Version Revision 015

This expression is a bit longer, but has a similar structure.

PR Create Version Revision 016

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".

PR Create Version Revision 017

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.

PR Create Version Revision 021

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.

PR Create Version Revision 022

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.

PR Create Version Revision 023

After you moved it down you now have some space.

PR Create Version Revision 024

Select the two labels from the original report layout and use copy.

PR Create Version Revision 025

Then you make sure that the band in which you want to paste the label in is active.

PR Create Version Revision 026

It is likely, that the labels will be copied at a position where you don't want them.

PR Create Version Revision 027

Just select them and drag and drop them where you want them to appear later.

PR Create Version Revision 028

For example like this.

PR Create Version Revision 029

Now we need the two calculated fields.

PR Create Version Revision 030

make a right-click somewhere in the "Field List" panel in your own report layout and select "Edit Calculated Fields...".

PR Create Version Revision 031

The following dialog will show up.

PR Create Version Revision 032

Click twice on the Add button.

PR Create Version Revision 033

Select the first items and click in "Name".

PR Create Version Revision 034

Type in ACP_VersionLabel.

PR Create Version Revision 035

Go to the original layout and use "Edit Expression...".

PR Create Version Revision 036

Copy the expression.

PR Create Version Revision 037

Go back to your layout and click on the "..." button.

PR Create Version Revision 038

The Expression Editor opens.

PR Create Version Revision 039

Paste the expression in it and click OK.

PR Create Version Revision 040

You see the beginning of the expression in the dialog.

PR Create Version Revision 041

Repeat this with the second expression from "ACP_VersionText".

PR Create Version Revision 042

Close the Report Designer and make sure you save the changes.

PR Create Version Revision 043

Test new Layout

Now create a new version of your report configuration.

PR Create Version Revision 044

We don't see the version in the file name yet. This will be explained in the next chapter Adapt Target.

PR Create Version Revision 045

However, we see the text and value in the report now.

PR Create Version Revision 046

If you create a revision...

PR Create Version Revision 047

... you see that as well.

PR Create Version Revision 048

Next Chapter: Adapt Target