Working with Vertical Lines in Report Writer

David Meego - Click for blog homepageIf you have ever used the SOP Blank Invoice Form or the POP Purchase Order Blank Form in Microsoft Dynamics GP, you will have seen the vertical lines on the report which make up the boxes around the various sections of the report.  This article explains how those vertical lines work and how to easily make changes to them.

Below is a screenshot showing an example SOP Blank Invoice Form with the vertical lines.  The lines we are specifically interested in are the vertical lines that join the header of the body section to the footer of the body section.

And here is a screenshot of the layout window for the same report.

Before we can discuss how to modify the lines we need to discuss how the lines work. So here it is.....

Boring Theory Bits

The size of the body section is controlled by the size of the paper less the size of the headers being used and the footers being used.  To ensure that the first page, last page and all inbetween pages have the same sized body section, we need to make sure that the Report Header (used for first page) and the Page Header (used for subsequent pages) are the same size AND that the Report Footer (used for last page) and the Page Footer (used for all other pages) are the same size.  If you click and hold on the RH, PH, RF and PF tabs, the size will be displayed at the bottom of the Toolbox window.

If we were to add short vertical lines to the body section and all the additional headers and footers, and made sure that they were the the correct height and horizontal position, it would be possible to have vertical lines showing.  The problem is that once all the body and additional headers and footers are printed, we probably have not reached the end of the page and so the lines would not meet up with the horizontal line at the bottom of the report. So this is not the method used.

The way it actually works is that we have the header block at the bottom edge of the Report Header and Page Header sections.  As part of that header block we have vertical lines of the required length hanging down.  Then at the top edge of the Report Footer and Page Footer sections, we have a horizontal line which is the bottom side of the enclosed area. The required length depends on the size of the body section which (as mentioned earlier) depends on the paper size and if you get it right, the vertical lines meet exactly with the horizontal line at the bottom.

Important Notes

Please note that there are in fact two sets of vertical lines hanging down, one set from the bottom of the Report Header and one set from the bottom of the Page Header.  If you make any changes to the length of the vertical lines, you will need to make the changes to all lines in both sets.  Also, not all the lines are the same length as the lines on the far left and right hand edges are taller to include the edges of the header block.

Useful Practical Bits 

So why would you need to change the size of the vertical lines?  Well, if you are using a different sized paper or wanted to change the size of the header or footer sections, you will need to adjust the lines to match.  If you did not, the lines would either be too long or too short and would look terrible.

The original reports were create based on US Letter sized paper, which is wider, but shorter than A4 paper.  There is an A4.CNK for Microsoft Dynamics GP which is available when installing for countries that use A4 (United Kingdom, Australia, New Zealand, South Africa, etc.).  This chunk updates the report layouts for reports that would not fit onto A4 paper properly.  Looking to support A4 paper without installing the A4.CNK or for a report not updated by the A4.CNK could be a reason to edit the line length.

To change the length of a line you can use 3 methods. It normally takes some trial and error to get the lines exactly right (with no gaps and over overlapping).

  1. You can use the mouse to click on the line to select it and then grab the end of the line and drag it longer or shorter.  This will change the size one grid size at a time, normally 12 pixels.
     
  2. You can use the mouse to click on the line to select it and then use the arrow keys to resize.  Use Shift-Down to make it longer by one pixel at a time or Ctrl-Up to make it shorter by one pixel at a time.
     
  3. You can use the mouse to click on the line to select it and then use the Visual Tab on the Properties window to change the Size-Height value to the desired new value.  Select Layout >> Properties or press Ctrl-M if the Properties window is not visible.

Hint: Using the arrow keys can move a selected object around one pixel at a time.  Holding shift and using an arrow key will make the object bigger in the selected direction. Holding control and using an arrow key will make the object smaller in the selected direction.

Note: A4 paper requires the vertical lines to be 50 pixels longer than US Letter paper, using method 3 you can quickly lengthen the lines. 

Another Hint: As there might be two sets of lines overlaid (one set from the Report Header and one set from the Page Header), when clicking with the mouse to select the line; Click on the top of the line in the RH section to select the lines hanging down from the PH section. Click on the bottom of the line at the bottom of the report to select the lines hanging down from the RH section.

I hope this makes working with vertical lines in Report Writer easier for you.

David