Conditional Display of Detail lines

Discussion forum about all things Report Builder (all versions).
Another 4.0 User

Conditional Display of Detail lines

Post by Another 4.0 User » 03 Jul 2012, 17:51

I am yet another 4.0 user associated with Visual Manufacturing's ERP solution and, yes, I have issues with Report Builder 2005 v4.0.0.

Firstly, are there any 4.x releases available beyond 4.0.0 which will work with Visual?

I have numerous issues, but will begin with conditional display of lines in a detail block. The report I am currently working with often goes several pages of detail and I have one line of fields (let's call them table headings) which I want to print only before the first detail row of each new page.

I defined a Total object called DetailRowCount and set it to Count (an appropriate input item) with Restart Event = On Page Break. Next, in the Properties box for the desired line, I entered a conditional display formula, "NumberIFF( DetailRowCount -1 , 0 , 1 , 0 )". In theory, the first record of each new page should have DetailRowCount = 1, and by subtracting 1 from that value, I can now say if the result is zero then print this line; if the result is greater than zero (or less than, though unlikely to occur), then do not print the line.

Of course, for reasons unknown, this doesn't work. Strangely, the line does print on the first page but is absent from all subsequent pages.

To test my work, I added three additional display fields in the Detail area: DetailRowCount, DetailRowCount-1, and NumberIFF( DetailRowCount -1 , 0 , 1 , 0 ) so that I could monitor these values. When the report runs, I see the following:

Page 1 record 1: 1 0 1
Page 1 record 2: 2 1 0
Page 1 record 3: 3 2 0
Page 1 record 4: 4 3 0
etc
Page 2 record 1: 1 0 1
Page 2 record 2: 2 1 0
Page 2 record 3: 3 2 0
Page 2 record 4: 4 3 0
etc
Page 3 record 1: 1 0 1
Page 3 record 2: 2 1 0
Page 3 record 3: 3 2 0
Page 3 record 4: 4 3 0

The final digit in each row is the same value the conditional display formula should be generating, thus my table header line should print with the first record of each page and not with the remaining records. As noted above, the table header line DOES print on page 1 but does not print on pages 2, 3, etc. Why?

If I eliminate the conditional display formula, the table header line prints once for each record, as expected. If I set the conditional display formula to a simple value ("1" for example), the line prints once for each record - again, as expected. However using the formula described above - which certainly appears to generate the desired output value - I cannot control the printing of this line as desired.

Another 4.0 User

Re: Conditional Display of Detail lines

Post by Another 4.0 User » 05 Jul 2012, 15:24

Well, I have identified the problem:

It seems that the decision on whether or not to print the table header line is being made prior to the occurrence of the page break. For example, if page 1 prints four records, I can make the heading print of page 2 by changing the conditional display formula to "NumberIFF( DetailRowCount - 5 , 0 , 1 , 0 )". This would be acceptable if each page contained the same number of records, however that is not the case. Each record contains a variable number of detail lines and a page may contain anything from around 5 to 15 records.

I cannot think of a workaround...

Jeff Luther

Re: Conditional Display of Detail lines

Post by Jeff Luther » 05 Jul 2012, 22:03

See my reply to you in your other thread: https://support.guptatechnologies.com/supportforum/viewtopic.php?f=19&t=8831
about contacting VISUAL and RB version info.

As to your issue. It's not really possible to 'debug' text too well, but a couple thoughts:
** Well, Page Header comes at each page (starting with pg 2 if your have a Report Header, starts at pg 1 otherwise). Maybe add a line to bottom of the PH ?

** "In theory, the first record of each new page should have DetailRowCount = 1"
Why? Where is DetailRowCount coming from? If that var. is correctly named, there may be 12 detail rows based on your example (4 x 3). Sounds like the var. is an input item and again, unless it's reset somehow start of each new page, it'll keep on incrementing for as many details as there are in the report.

"Strangely, the line does print on the first page but is absent from all subsequent pages."
Well, based on my theory above first page is where that var. = 1.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests