I'm continuing the Report Writer series with a brief article on Sections in Report Writer. Every once in a while I see a question on a forum "My field didn't print and I don't know why!". Hopefully, this will help answer that kind of question!

Generally speaking, a report will have at least 5 sections to it, in this order:

  • Report Header - this prints on the first page of the report only
  • Page Header - depending on the settings, this prints on every page or on "page 2" onwards.
  • Body - the guts of the report
  • Page Footer - same as Page Header, this either prints on the bottom of every page or only on Page 1 to the second last page of the report.
  • Report Footer - this prints on the last page only

First, let's start with the Report Definition window, specifically the Printing Options section.  This will help determine when a Page Header (PH) and Page Footer (PF) sections will print.

Report Definition window.
Report Definition window.

In my screenshot, this particular report will NOT print a "first page" Page Header but will print a "last page" Page Footer. Looking at the layout of this report, here is a description of what will and won't print on the first page.

Report Layout window for the PM Historical Aged TB report.
Report Layout window for the PM Historical Aged TB report.

At the very top is the PH (Page Header). In my case, this will not print on the first page, but it will print on Page 2 to the last page of the report. Part of it is the same as the RH (Report Header) section. On this report, the Report Header (first page) shows the legend of what the report options were, which only needs to be printed on the first page. I could change this - and print the same thing on every page by moving those sections to the PH section and hiding the RH section.

Similarly to the PF and RF sections (Page Header and Report Header respectively), on this report, the PF was already hidden and I needed to go into the Section Options to unhide it for this pic.  It is empty because this particular report doesn't need two footer sections or a footer on each page.

When might users want a PF section? Perhaps they have a report where they want a subtotal of the report data on the bottom of each page - that's a good time to have a page footer.

What does this mean when editing or creating a report?

This impacts where fields are put as well as where titles are moved or edited. One very common mistake I see is when someone edits a report but uses sample data that is only one page long. They never test what Page 2 beyond looks like. Then Page 2 prints and lo and behold, the titles don't line up. Why? They didn't make the same changes in the PH section that they did in the RH section.

Similarly, I've seen people make a ton of changes to the PH section only to ask why their new changes didn't show up. If printing a one-page sample and not making the same changes in the RH section, the changes won't print (assuming the same Report Definition settings of no first-page header).

So, test with a multi-page report if possible and make sure to keep the PH and RH sections in sync if they are intended to be similar to what they are for many reports.

Other sections

There are tons of other sections on most reports in Dynamics GP, which are all sections of things where reports are grouped or sorted.  Below is what the section options window looks like. Open this window by going to the Tools menu in Report Writer.

Report Section Options showing which sections will be printed.
Report Section Options showing which sections will be printed.

First, this shows what sections are visible in the Report Writer layout window.  This is the part of Report Writer where one becomes a bit of a detective sometimes to figure out what the default sections are if they are not obvious. In my report, a Payables Historial Aged Trial Balance (HATB), there are 2 extra header sections and one extra Footer section. To view more about the extra sections, click on one, then click on Open to view the settings.  That is what tells the user what the section is for.

Header Options for a section called Vendor.
Header Options for a section called Vendor.

In this particular case, the section is grouped by Vendor ID. The sections are "Print when this field changes" meaning, for each vendor ID change, print this section. In the layout window screenshot above, this section is called H1 (note: it's listed first, therefore it's the first header, and the numbering is in sequence from top to bottom). The H1 section contains only Vendor information, no transactional information, because that wouldn't print properly up here… it also contains some headings, so that within a report for this vendor (aging detail in this case), the headings print before that vendor's transactions to make it easier to read.

Here is where there are some options. Some people prefer the headings to print once per page, not once per section. In that case, I would move the headings (the Aging Bucket fields, etc.) up to the RH section AND the PH section. Remember, this report prints the RH for page 1 and the PH for page 2 onwards. So, I need it on both headers so it prints at the top of each page.

Here is what the report looked like before the change:

The PM HATB report before I made my changes.
The PM HATB report before I made my changes.

I've modified this report a bit already to highlight each new vendor section and the total due - but I left the headings in the "per vendor" section. Each vendor has the same headings. Here is what it looks like moved to a different section:

The next version of the report with the headings moved to the section above vendor.
The next version of the report with the headings moved to the section above vendor.

Now the headers are at the top of the page, and there is no additional info between the vendors. I find this harder to read but it does save space and make the report look a little less cluttered.

When it gets a little more complicated!

One last example of where being a detective comes in handy. Project Accounting is one reporting dictionary where so many things are configurable in the product itself, that the Report Writer side seems entirely generic and a giant mystery!  Here's a screenshot of a Project Accounting invoice and it's a bit scary looking at first!

A more complicated example such as Project Accounting reports that have multiple sections to identify.
A more complicated example such as Project Accounting reports that have multiple sections to identify.

Every section is generically named - Group 1 Break, huh? Go into a section, and the "Print when the field changes" doesn't exactly help. One key field that may help is "Suppress When Field is Empty" - this is a calculated field, that defines when this section prints or doesn't print. Sometimes I will look at the calculated field to see if I can figure out what the break or related data is.

Unfortunately, in this case, the calculated field simply refers to the same field name above, a generic "group 2 break" field.  So, that doesn't help me here.

Next, I will look at the fields that are in that section. Most times this is where I start to figure out the sections. For example, this section only has one field which is a calculated field. Here is what it says:

Calculated Field Definition for one of the label headers.
Calculated Field Definition for one of the label headers.

From this point on, I should point out, that without an understanding of the underlying structure of the module users are creating a report for, that is the best place to start… someone who doesn't know anything about Project Accounting would be hard-pressed to figure out the sections by looking at the report.  For me, having used PA for years and years, this is where it starts to make sense. This section I now know is a heading that simply describes the content to follow - either Billings or Fees.

What if that doesn't help?

I'd be lying if I said I could figure it all out just by doing this. Sometimes I don't want to spend the time looking at this level of detail so I will take another approach: put a unique piece of text in each section I need to know more about and then print the report - or print several of the reports with different options enabled. Looking at the raw output tells me what data prints where and hopefully that will help me figure out if it's a section I could hide or need to keep.

In Summary

The biggest caveat I can give for sections - particularly around whether one can delete or hide sections - is to go slowly and try things out, continually printing test reports to see the effect. Test with lots of data, especially in a report with multiple sections. The sections are usually grouping and totaling things and a major change in a section will result in incorrect data.

TIP: know the test data. Create test data before starting to modify it too much, so a baseline report that has correct groups, subtotals and totals before making major changes. As changes are made, specifically hiding or removing sections, check all of the subtotals and totals. Removing a group that matters, will make a subtotal or total incorrect in a hurry and should stand out.

Hopefully, this gives someone a bit of headway into what the various sections mean and how to navigate them.