Report Contains Too Many Fields to Fit on a Sheet

Report Contains Too Many Fields to Fit on a Sheet

I am outputting a report that contains more fields than will fit on a single sheet. The process has to be done as three separate reports:

  • Report 1 – Fields 2 to 14
  • Report 2 – Fields 15 to 27
  • Report 3 – Fields 28 to 40

How can I put variables into the report fields to point to the relevant table fields? This would enable me to use one report and vary the field reference. I hope this makes sense.

This can be accomplished using the EVAL() and FIELD() functions in combination with a memory variable that holds the field number of the first column in the report. Here is a simple example that will demonstrate the solution.

Let’s say that you have a table with seven fields in it (f1, f2…, f7). Let’s also say that the report that you create can only show three columns.

First create a report, add the table to the data environment of the report, and then put three fields onto the report designer surface. Fill in the expressions and the “Print When”s as follows:

Field      Expression                    Print When-----      ----------                    -----------First      EVAL(FIELD(lnStartField))     !EMPTY(FIELD(lnStartField))Second     EVAL(FIELD(lnStartField+1))   !EMPTY(FIELD(lnStartField+1))Third      EVAL(FIELD(lnStartField+2))   !EMPTY(FIELD(lnStartField+2))lnStartField = 1REPORT FORM MyREPORT && shows fields 1-3lnStartField = 4REPORT FORM MyREPORT && shows fields 4-6lnStartField = 7REPORT FORM MyREPORT && shows only field 7

You can use the same technique to make sure that the column headers in the report give the correct field name above its value. Create three fields (not labels) in the page header of the report, corresponding to (and right above) the three fields you first added. Set their expressions and “Print When”s as follows:

Field      Expression              Print When-----      ----------              -----------First      FIELD(lnStartField)     !EMPTY(FIELD(lnStartField))Second     FIELD(lnStartField+1)   !EMPTY(FIELD(lnStartField+1))Third      FIELD(lnStartField+2)   !EMPTY(FIELD(lnStartField+2))

Notice that the EVAL() function is not used because we want the name of the field, not the contents of the field.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved