Problem showing detail records
I have a fairly complicated report which has some logic in the rap code for
deciding whether or not to print a particular record. However the records
need to be grouped together and i only want a group header or footer if
there are records in the group and hence i have also written a little bit of
code to do this rather than using the grouping option in the reportwriter.
However i have noticed a problem when i have several regions making up a
detail band and one of those regions crosses onto another page. Once it has
done this i get no more pages generated.
I have created a simple example which i have attached to demonstrate the
problem. It looks like their maybe a problem when the detail band has
several regions and one of those regions requies to be printed on the next
page. I have tested the problem and moving components and making certain
bands bigger makes the report work but only becuase the changes mean that no
region in the detail flips over the page.
Any help in resolving this would be much appreciated.
Thanks
Tony
deciding whether or not to print a particular record. However the records
need to be grouped together and i only want a group header or footer if
there are records in the group and hence i have also written a little bit of
code to do this rather than using the grouping option in the reportwriter.
However i have noticed a problem when i have several regions making up a
detail band and one of those regions crosses onto another page. Once it has
done this i get no more pages generated.
I have created a simple example which i have attached to demonstrate the
problem. It looks like their maybe a problem when the detail band has
several regions and one of those regions requies to be printed on the next
page. I have tested the problem and moving components and making certain
bands bigger makes the report work but only becuase the changes mean that no
region in the detail flips over the page.
Any help in resolving this would be much appreciated.
Thanks
Tony
This discussion has been closed.
Comments
This thread will be deleted shortly.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Tony
I get the behavior you describe in the demo. It appears that the detail band
is firing its before print event quite often. Can you create a calculated
field on the dataset to filter the records instead of trying to turn the
regions on and off? The only thing which I can think of is that your code is
going to fire again when the detail band prints on the next page. Can you
move this code into Delphi event handlers temporarily to debug the code to
see if you are turning the visible properties all off for the second page
when the detail band fires for the second time for the same detail band? It
appears that the detail band is printing, although there is no components in
the band to print.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
to display for this record, however the problem arises because not all of
these bands can fit in the bottom of the page. This then stops the report
processing records? Any ideas?
Thanks
Tony
not true, which is what I would expect it to be in order to cause any
problem. I've been playing around with the demo to simplify it, but I can't
get it to behave incorrectly without any code in the BeforePrint event. It
think it is ppRegion2 that is causing the problem. The page breaks, and the
BeforePrint event fires, and only the ppRegion2 gets set to visible and then
it hangs. I'll debug it further.
Have you tried filtering the dataset approach? There are a lot of records
which never print in the report which is why I say this could be an
optimization you may want to consider:)
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
behind the scense and these are used to determine wehether records are being
dipslayed or not - i obviously simplified this selection for the example but
that is why i do it like this.
I have come across this problem in the past and worked around it using the
RBAddon page break when less than a certain area exists on page, however i
would prefer to get to the bottom of the problem this time as my customers
are creating some of their own reports and having the same issues. So any
help is much appreciated.
Let me know fi you need any more info from me
Tony