Group.BreakNo
I'm running RB 7.04 (second build) and I'm getting incorrect values for the
Group.BreakNo property. It appears that the BreakNo value is always 1 less
than the actual number of times that the group is printed.
As a simple test case, I created a report that with DADE query that pulls
back 1 string field and limited the results down to just 1 row. I created a
group in the designer and placed a DBText field pointing to the one field in
the group footer so that I know that it actually breaks at least once.
In the summary band of the report, I created a variable with the following
in the OnCalc event: Value := Group1.BreakNo;
When the report is run, I get a BreakNo value of 0. If I change the query
to include more than one row, it always shows 1 less than the number of
group footers printed. Changing the timing of the variable or the LookAhead
property doesn't make any difference.
Any way to get the Group.BreakNo value to be correct in the summary band of
the report?
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
Group.BreakNo property. It appears that the BreakNo value is always 1 less
than the actual number of times that the group is printed.
As a simple test case, I created a report that with DADE query that pulls
back 1 string field and limited the results down to just 1 row. I created a
group in the designer and placed a DBText field pointing to the one field in
the group footer so that I know that it actually breaks at least once.
In the summary band of the report, I created a variable with the following
in the OnCalc event: Value := Group1.BreakNo;
When the report is run, I get a BreakNo value of 0. If I change the query
to include more than one row, it always shows 1 less than the number of
group footers printed. Changing the timing of the variable or the LookAhead
property doesn't make any difference.
Any way to get the Group.BreakNo value to be correct in the summary band of
the report?
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
This discussion has been closed.
Comments
ReportBuilder does not consider the last group printed to have "broken" so
therefore would not count the only group in the report to have broken. If
you are using the BreakNo property to count the actual number of groups
printed, you will need to add one to get the correct value.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
But doesn't the group have to break at least once in order to print the
header and footers? The RB help says for the BreakName property that "Each
time this value changes, a group break occurs." which results in the group
being printed. I would assume from this description that because the value
changes from null to some value for the first record in the DataPipeline and
that the group is triggered, that the BreakNo should be incremented before
the group header is printed. If it didn't break at least once, the group
would never print.
My comments above are more of a vent than an attempt to argue about how RB
works and were included to explain why I believe that the BreakNo count is
incorrect.
Might I suggest that the future versions of RB include a new group band
property called "TotalPrintCount" which indicates how many times the group
or band has actually printed. This would help tremendously because the
solution above doesn't work for reports where no records are printed as
incrementing the BreakNo would show 1 even though no groups were ever
printed.
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
Thanks for the feedback. I will mark this down as a possible enhancement.
One note, just because no records are printed as a result of a break value
change, does not mean that the group will not print. The group header and
group footer should still print and the group should break when the break
value changes again. If this "no records" group were the only group on a
report, it will act the same way a group would act if it did have records to
display. You could possibly check for no records and in this specific case,
leave the group count at 0.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Understood, and that's probably what I'm going to have to end up doing. I
don't mind doing this as a developer behind the scenes, but since I'm
including an end user report designer it will be a bit embarrassing telling
the end user that they have to check to see if there are records and add 1
if there are and not to add 1 if there are not.
Anything that can provide the end user designer with absolute values that
don't need to be conditionally adjusted makes it simpler for the end user
and less tech support for the developer.
Thanks again for the reply. It is appreciated.
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com