Skip to main content

Two column or multi-column layout in the Report Designer, two approaches

  • January 24, 2025
  • 3 replies
  • 91 views

plambert
Jr Varsity II

I recently had the task of creating a report with a two-column layout and was surprised at the lack of guidance available, so I am posting my results for the next person to find more easily. 

Hiding alternating rows formula: 

The key to creating multiple columns pull more than one record of data into a section and then to toggle the visibility of that section by a formula that uses the modulus (% operator) of the row number.

First create a variable for the detail section, $RowNbr, with a value of =$RowNbr + 1. If you have groupings for your data, then also set that $RowNbr variable in the parent group to have a value of 0, which will reset the counter in each grouping.

Then for the VisibleExpr of that detail section, set the value to =$RowNbr % 2 = 1 to look something like this:

Record 1          Record 2    (visible)

$Record 2          Record 3   (hidden)

Record 3          Record 4    (visible)

Record 4         Record 5   (hidden)

 

Displaying multiple records in one section with NEXT():

One approach to display multiple records in one detail section is to use the NEXT() function. Intuitively, the NEXT() function returns the value of the next record, or null if there are no more records after the current record for the current grouping.

Two records’ values in one section

An example of this in practice can be found on the Inventory Item Labels report (IN619200) to print two labels per section.

Personally, this is not the approach I used. I actually needed three columns and wrapping every value in Next(Next()) got very cluttered the more complicated the formula was. Also, if ever changes would be needed later, they must be applied to all three columns of data which opens the door to one section being out of sync with the other; I don’t like code repetition like that.

 

Displaying multiple records in one section with a subreport:

My solution was to create a subreport that represents a single column. The technique is the same inside the subreport for hiding alternating lines, but instead of a fixed value in the VisibleExpr, I used a parameter, “=$RowNbr % 3 = [@VisibilityMod]”.

(If you want even more flexibility, you can have another parameter for how many columns there are in total, for something like “=$RowNbr % [@Columns] = [@VisibilityMod]”, but that is probably overkill unless you reuse the subreport)

Back in the main report, I add three instances of this subreport. The VisibilityMod parameter of the first subreport is 1, the second 2, and third 0, noting that 3 % 3 = 0. Also, these sub reports must be placed in the header/footer of a group instead of the detail section. Thus, a dynamic multi column layout with the subreports working like this:

Subreport1       Subreport2       Subreport3

Record 1          Record 1          Record 1

Record 2          Record 2          Record 2

Record 3          Record 3          Record 3

Record 4           Record 4         Record 4

Did this topic help you find an answer to your question?

3 replies

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2756 replies
  • February 10, 2025

Thank you for sharing this tip with the community ​@plambert!


  • Freshman II
  • 7 replies
  • March 25, 2025

Hello ​@plambert!

The first section was super helpful and gave me what I needed for a label report, but I could not follow the subreport section. Can you please provide more information on this section? Specifically, about where you put the @Columns and @VisibilityMod on the subreport. It is also unclear how you set the VisiblityMod parameter for each subreport. I appreciate the help!

 

-Kelsi

 


plambert
Jr Varsity II
  • Author
  • Jr Varsity II
  • 8 replies
  • March 27, 2025

I’m glad I could help, ​@kelsi54! Hopefully this will save some paper.

For the subreport, here’s what my setup looks like:

I set up a parameter named ‘VisibilityMod’ which I used in the VisibleExpr of my detail section. Here, I hard-coded a value of 2 in the expression, so only every other line is visible.

Then in my main report I provided parameter values of 1 and 0 to my two instances of the subreport, like this dramatic reenactment:

An alternate setup for the subreport would be to have a second parameter for the total number of columns - to replace my hard-coded 2. I didn’t actually end up using the subreport method in the end, but I thought it might be a useful trick for someone else’s unusual situation.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings