Discussion:
QuickReport crash EFCreateError
(too old to reply)
Paul E. Schoen
2010-04-25 10:07:09 UTC
Permalink
I have recently added a Quick Report component in my D4 application, and as
it was my first attempt it took a little while getting things to work. But
finally I was able to generate reports (print preview) and all seemed fine,
but then I sometimes got this EFCreateError saying it cannot create file
'$%^#@' or some such gobbledegook. Sometimes also I got an error like
"Canvas does not support object".

I have a SubDetailBeforePrint procedure which adjusts the colors of some
text, and using the debugger it seems to crash when it processes the last
record. But I could not see any real problem. The print preview actually
shows but it seems like the final record causes the crash.

Finally I was able to determine that there was one record that caused the
problem if I used the ID Field text 'Test1', and then selected for all
ID='Test1' for the report. But if I named it 'Test2' it was OK, whether I
selected for ID='Test1' or ID='Test2'. I can also delete the record and
other records with ID='Test1' seem to be OK, but if I make a new record with
that ID it crashes. I'm about tapped out. Maybe I'll find it tomorrow after
I get some sleep.

The other strange thing I saw before this problem happened, is that the
print preview showed some of the data text in green or red as I intended,
but in the actual print (using a PDF creator engine) I sometimes get a wrong
color on one or more lines. And also I have some lines that are 4 points
wide, and show as thick lines in the print preview, but the PDF shows them
as thin. And when I first started working with Quick Reports it seemed that
the lines showed up as the correct width in the PDF.

Any ideas appreciated. Thanks.

Paul
Jamie
2010-04-26 13:06:08 UTC
Permalink
Post by Paul E. Schoen
I have recently added a Quick Report component in my D4 application, and
as it was my first attempt it took a little while getting things to
work. But finally I was able to generate reports (print preview) and all
seemed fine, but then I sometimes got this EFCreateError saying it
got an error like "Canvas does not support object".
Are you doing things in a timer event or multiple threads? It sounds
to me like you maybe suffering from collision of resources? Or, you're
running out of resources due to some not being release earlier. ?
Post by Paul E. Schoen
I have a SubDetailBeforePrint procedure which adjusts the colors of some
text, and using the debugger it seems to crash when it processes the
last record. But I could not see any real problem. The print preview
actually shows but it seems like the final record causes the crash.
Finally I was able to determine that there was one record that caused
the problem if I used the ID Field text 'Test1', and then selected for
all ID='Test1' for the report. But if I named it 'Test2' it was OK,
whether I selected for ID='Test1' or ID='Test2'. I can also delete the
record and other records with ID='Test1' seem to be OK, but if I make a
new record with that ID it crashes. I'm about tapped out. Maybe I'll
find it tomorrow after I get some sleep.
The other strange thing I saw before this problem happened, is that the
print preview showed some of the data text in green or red as I
intended, but in the actual print (using a PDF creator engine) I
sometimes get a wrong color on one or more lines. And also I have some
lines that are 4 points wide, and show as thick lines in the print
preview, but the PDF shows them as thin. And when I first started
working with Quick Reports it seemed that the lines showed up as the
correct width in the PDF.
I assume you must be using the PDF printer for this ?

starting to sound like corruption to me. May want to check for
memory overruns in your code, extending past a max length in some
string or block/Record handling ?,z............ just a guess.

Or the real kicker, using old pointers/resources that were released
before. Some times this can run silent as it appears to keep working
because windows or something else in your code hasn't yet shifted that
resource to other duties! On a non busy machine, you'll see the effects
of released resource reused less evident. This was really a hidden bug
in many app's in the 9x box days. I had myself had a bug like that, that
never showed it's face until windows 2k came along.. and then the
reports of strange random things were happening and only on some
machines. It turned out that I was reusing a handle in the DLL in audio
functions that I had released a few lines before that. In 9X box this
worked just fine because of how the many was handled. Memory returned to
the OS was placed at the button and new memory was given out at the top
and the game just cycled around... Then, when W2k came out, they decided
to simply reused currently returned memory to reduce page flipping to
increase OS speed. That is when many programmers found out they had
BUGS!!!!!!!!!!!!!!!!!!

Have a good day..
Paul E. Schoen
2010-04-26 06:15:31 UTC
Permalink
Post by Jamie
Post by Paul E. Schoen
I have recently added a Quick Report component in my D4 application, and
as it was my first attempt it took a little while getting things to work.
But finally I was able to generate reports (print preview) and all seemed
fine, but then I sometimes got this EFCreateError saying it cannot create
like "Canvas does not support object".
Are you doing things in a timer event or multiple threads? It sounds
to me like you maybe suffering from collision of resources? Or, you're
running out of resources due to some not being release earlier. ?
There are one or more timers in the application but I doubt the problem lies
there, as things worked well enough until I added the QR module. I'm not
using threads in this mode of operation.
Post by Jamie
Post by Paul E. Schoen
I have a SubDetailBeforePrint procedure which adjusts the colors of some
text, and using the debugger it seems to crash when it processes the last
record. But I could not see any real problem. The print preview actually
shows but it seems like the final record causes the crash.
Finally I was able to determine that there was one record that caused the
problem if I used the ID Field text 'Test1', and then selected for all
ID='Test1' for the report. But if I named it 'Test2' it was OK, whether I
selected for ID='Test1' or ID='Test2'. I can also delete the record and
other records with ID='Test1' seem to be OK, but if I make a new record
with that ID it crashes. I'm about tapped out. Maybe I'll find it
tomorrow after I get some sleep.
The other strange thing I saw before this problem happened, is that the
print preview showed some of the data text in green or red as I intended,
but in the actual print (using a PDF creator engine) I sometimes get a
wrong color on one or more lines. And also I have some lines that are 4
points wide, and show as thick lines in the print preview, but the PDF
shows them as thin. And when I first started working with Quick Reports
it seemed that the lines showed up as the correct width in the PDF.
I assume you must be using the PDF printer for this ?
I am using Nitro Pro PDF Creator. But the same result if I used the Windows
XPF Document Writer.
Post by Jamie
starting to sound like corruption to me. May want to check for
memory overruns in your code, extending past a max length in some string
or block/Record handling ?,z............ just a guess.
Or the real kicker, using old pointers/resources that were released
before. Some times this can run silent as it appears to keep working
because windows or something else in your code hasn't yet shifted that
resource to other duties! On a non busy machine, you'll see the effects
of released resource reused less evident. This was really a hidden bug
in many app's in the 9x box days. I had myself had a bug like that, that
never showed it's face until windows 2k came along.. and then the reports
of strange random things were happening and only on some machines. It
turned out that I was reusing a handle in the DLL in audio
functions that I had released a few lines before that. In 9X box this
worked just fine because of how the many was handled. Memory returned to
the OS was placed at the button and new memory was given out at the top
and the game just cycled around... Then, when W2k came out, they decided
to simply reused currently returned memory to reduce page flipping to
increase OS speed. That is when many programmers found out they had
BUGS!!!!!!!!!!!!!!!!!!
I updated Delphi 4 Pro with the updates #2 and #3, and now sometimes at
least it does not totally crash. When I get the print preview it seems to
cause the EFCreateError when the second page is created. And if I navigate
to the second page it throws an EInvalidGraphic error "Metafile is not
valid".

I removed the graphics (lines and a rectangle), but same problem.

This is running on Vista Business SP1. To make it work I had to relocate the
NetFileDir to the ProgData folder. I suspect a possible problem related to
that, if perhaps the MetaFile is to be created in the root directory which
is apparently protected. But I still would not expect the file name to be a
jumble of characters which are invalid for a file name. Maybe sometimes by
chance the file name is valid?

My next step might be to create a separate application so I can isolate this
problem from the large app where there very well may be bugs.

Thanks for the ideas.

Paul
Paul E. Schoen
2010-04-26 08:07:12 UTC
Permalink
After reading through a tutorial on Quick Reports in
http://delphi.about.com/library/bluc/text/uc051701c.htm
I learned that the version of QR released with D4 was "not ready for
primetime" so I suspect it may have bugs. I found the following and I
downloaded it, but have not yet installed it.

http://freereport.smartcode.com/info.html

Any experience or suggestions? Is there a download of an updated version? Or
should I look into just purchasing it from qsoft? In that case, would it be
better to just get a more recent version of Delphi?

Thanks,

Paul
Paul E. Schoen
2010-04-26 08:23:15 UTC
Permalink
I found a free download on the
http://www.qusoft.com/WebInfoPage.aspx?WebInfoID=620 website, and after
installing it the problem seems to be fixed.

Now I can go back and add the fancy stuff I removed.

Thanks,

Paul

Loading...