Bug with grouping and null values
I have a report that has 5 dataview... one master and 4 detail dataview.
Basically the master is Software, and the details are various different
Licenses for that software (Site Licenses, Freeware, User Licenses etc.).
The master is a join on two tables Software and Publishers... using a
PublisherId in the software table to get the PublisherName from the
Publisher's table.
In the report design, the Main report (Software) is grouped by Publisher.
And the detail shows, for each product, the product, version and then 4
subreports (one for each license type). This works fine, prodviding each
software product has a publisherId - however, if the publisherId is NULL,
then the lookup (PublisherName) is also null, and this is used in the groups
for the report design. In this case, the whole report goes haywire and ALL
of the licensing subreports for ALL of the products get printed in the
detail band for the FIRST software product...
I presume this has something to do with NULL comparisons.
For the time, I'm getting around this by defining a view to select
PublisherName as '' for all software products without a publisherid and
doing a UNION join with this and a list of all the software with non null
publishers... then using this as the source for my report - but this is not
something that my users will be able to do in a similar circumstance.
Best Regards,
James Crosswell
Software Engineer
Microforge.net Limited
http://www.microforge.net
Basically the master is Software, and the details are various different
Licenses for that software (Site Licenses, Freeware, User Licenses etc.).
The master is a join on two tables Software and Publishers... using a
PublisherId in the software table to get the PublisherName from the
Publisher's table.
In the report design, the Main report (Software) is grouped by Publisher.
And the detail shows, for each product, the product, version and then 4
subreports (one for each license type). This works fine, prodviding each
software product has a publisherId - however, if the publisherId is NULL,
then the lookup (PublisherName) is also null, and this is used in the groups
for the report design. In this case, the whole report goes haywire and ALL
of the licensing subreports for ALL of the products get printed in the
detail band for the FIRST software product...
I presume this has something to do with NULL comparisons.
For the time, I'm getting around this by defining a view to select
PublisherName as '' for all software products without a publisherid and
doing a UNION join with this and a list of all the software with non null
publishers... then using this as the source for my report - but this is not
something that my users will be able to do in a similar circumstance.
Best Regards,
James Crosswell
Software Engineer
Microforge.net Limited
http://www.microforge.net
This discussion has been closed.
Comments
Null values are not going to work for data linking or grouping. Both of
these rely upon data collation (i.e. sorting, which in my experience is
undefined for nulls). Null values in general cause all sorts of issues for
all of the software written to access the null data.
If possible redefine the data so that that an unassigned publisher contains
a -1 (or some other designated value like that).
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks for the feedback. I am willing to research it. Please create a simple
example using Paradox or Access data. Email in zip format to
support@digital-metaphors.com.
If you want to trace the source code in the debugger that might help as
well. You can modify the Delphi library path from RBuilder\Lib to
RBuilder\Source and then trace the code in ppClass.pas, the method
TppGroup.CheckForBreak. Here is the code for that method:
FPriorValue := FBreakValue;
FBreakValue := GetCurrentValue;
if (FBreakValue <> FPriorValue) or ((DataPipeline <> nil) and
(ppdaNoRecords in DataPipeline.State)) then
ForceBreak;
Another possible work around would be to use the TppGroup.OnGetBreakValue
method to override the null value.
ReportBuilder is in extremely wide use and to date we have not had any
reports of this issue. Perhaps nulls do work for groups or perhaps noone has
ever tried it?
It has been my considerable experience that null data causes many issue in
software. Again that's my experience - I'm sure others will tell me how
great they are.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Please use paradox or MS Access. TIA
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com