Wood Foster-Smith
August 16, 2007
Objective:
To create a list report that wraps into columns across the page (“page-columns”) before breaking to the next page. This is useful when an ordinary list report has a layout that is narrow (i.e. it’s only a few list columns wide, and more than one of the list could fit across the page) and breaking at the bottom of each page takes up more space than is necessary.
Challenge:
ReportNet does not have settings for list reports that will automatically wrap the list into page-columns.
Solution:
Create a table with one row and as many columns as you want columns across the page. Insert identical lists into each cell, but use the MOD function to select only rows for each list that should appear in that page-column.
Caveats:
This technique will only work for list reports that do not contain group headers and footers.
This technique will only work for list reports where the height of each row is always the same, and the width of each row will never exceed the width of the desired page-column.
Step-by-Step:
- Create your base list report using a query called “Base.”
- Lay out your rows carefully. You must be sure that the each row in your list will always take up the same amount of vertical space on the page. That is, each row must take up one line, or each row must take up two lines, etc. If some rows are one line and some are two (i.e. if the vertical space can vary depending on how much data is in the row, such as when text wraps to a second line), then this technique will not work. Also, you may not use group headers and footers in your list. If you do, this technique will not work.
- In the List properties, set the “Contents Height” property to “Minimal” and the “Column Titles” property to “At start of details.”
- Add all page headers and footers and adjust the page margins to the way you will want them in your final report. Run the report to PDF format. Make any adjustments to formatting so that your list is the way you want it to look before you proceed further.
- Look at the widest row of data in your list and, based on that width, determine how many page-columns will fit across the page. Call this number “pagecolumns”. For this example, pagecolumns = 3.
- Count the number of rows that fit on the page in the current layout. Call this number “columnrows.” For this example, columnrows = 54.
- Add two calculated fields in the tabular model and query for “Base”:
- rownum: running-count([PERSON_UID]) (or any column in the list). This will produce a straight running count of every row in the list beginning with 1.
- mod: mod([rownum], pagecolumns * columnrows) For this example the formula is mod([rownum], 3 * 54). The mod function returns the remainder after dividing the first argument by the second argument. When using [rownum] as the first argument and pagecolumns * columnrows as the second argument, what this will result in is a straight running count that will count from 1 up through the second argument minus 1 (in this case (3 * 54) - 1 or 161), then start over at 0 and count up to 161 again, and so on until all the rows are counted. 162 (zero through 161) is the total number of rows that will appear on one page (3 page-columns * 54 column rows).
- Bring [rownum] and [mod] data elements into the “Base” query.
- Create copies of “Base” for each page-column you want to create: