Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

simultaneous reports interfere with each other.

edited May 2009 in General
RB 10.07 Delphi 7

I have a problem with the TppReport control. I am using its modeless state
so I can have multiple reports open simultaneously. The problem I am seeing
is that reports that access the same table seem to interfere with each
other. Both reports access a users table and include date and time
information. On the report I show this date time information using a
variable (see code below). The first report I open shows the details
correctly. When I open the second report (the same report but now I have two
open) the Date time elements show all the same value and not the various
dates and times held in the database ! When I create the TppReport object at
runtime I pass in a reference to the parent form. If I create the controls
but pass in "nil" the problem goes away ! Any ideas ? Unfortunately when I
create the controls and pass in nil I get other issues so passing in "Self"
is the preferred approach.

if OPACTHIS['Date'] <> 0 then
begin
Value := DateToStr(OPACTHIS['Date']) + ' ' + OPACTHIS['Time'] ;
Detail.Visible := true ;
end
else
begin
Detail.Visible := false ;
end ;

Comments

  • edited May 2009
    Hi Ian,


    Yes, this is not surprising, though it may work in some simple cases, it is
    easy to see how there could be notification conflicts when two reports (with
    the same owner) are accessing the same dataset. Have you tried using
    separate datasets/pipelines or DADE?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    Ian:

    As long as you are not creating the reports simultaneously, the work around
    for this would be to create an archive report and view that. After the
    archive is created, the data will no longer be touched, and the other views
    can work on the data.



    Ed Dressel



This discussion has been closed.