Board index » delphi » Problem printing with QR 2.0J and Delphi 1

Problem printing with QR 2.0J and Delphi 1

Hello all,

I am currently using version 2.0J with Delphi version 1.0.  I am having
problems printing my reports.  When I am in design mode and do a print
preview and then print the report from there everything works fine and the
report comes out on the printer and looks exactly as it should.  The problem
occurs when I attempt to do the same thing in run-time mode from the .EXE
file.  I click on the Print button and the Printing in progress dialog
briefly appears.  As soon as it appears the program GPF's and exits back to
Windows.  I have tried everything I could think of to fix the problem, but
no matter what I do it always drops out.  Has anyone else experience this
problem?

Thanks in advance,
Frank
zid...@en.com

 

Re:Problem printing with QR 2.0J and Delphi 1


Never mind --
It turns out I needed to increase the stack size for the application.
Should have read the FAQ first!!

Frank

Quote
Frank J. Zidar wrote in message <69qj11$fp...@forums.borland.com>...
>Hello all,

>I am currently using version 2.0J with Delphi version 1.0.  I am having
>problems printing my reports.  When I am in design mode and do a print
>preview and then print the report from there everything works fine and the
>report comes out on the printer and looks exactly as it should.  The
problem
>occurs when I attempt to do the same thing in run-time mode from the .EXE
>file.  I click on the Print button and the Printing in progress dialog
>briefly appears.  As soon as it appears the program GPF's and exits back to
>Windows.  I have tried everything I could think of to fix the problem, but
>no matter what I do it always drops out.  Has anyone else experience this
>problem?

>Thanks in advance,
>Frank
>zid...@en.com

Re:Problem printing with QR 2.0J and Delphi 1


Hi Frank,

I also use Delphi 1.02 but I use QuickReport 1.1a. I was having the same
problems you are having. A couple of others have helped me with this so
I can only offer their suggestions. Their suggestions have worked for
_me_ so far. Of course, this may not help _your_ problem at all, GPF's
can occurr for a variety of reasons.

First lesson I learned:

Check the Stack size in your Options/Project/Linker tab. If its at the
default (8192) then you need to increase it. With my QR1.1a, upon
increasing the Stack to 12k and leaving the heap set at 8192, my GPF's
went away in _most_ of my reports. I believe that with QR2.xxxxxxxx,
however, you might need to double your stack size, or more, to
accomodate QR in your EXE.

A fellow Delphite gave me this rough method to figure out your stack
size in 16-bit Delphi (get the required info from the
Compile/Information dialog after doing a Build All):

Stack = 64000 - DataSize - HeapSize

Second lesson I learned:

Until your app is ready to distribute, turn on ALL Run-Time Compiler
switches in the Options/Project/Compiler tab. After I did this the 2
remaining reports that still gave GPF's were then traced to my own
stupidity: I had referenced undefined arrays elements! You will get nice
little run-time exception windows showing your uh-ohs! Of course, once
your app is "bug-free" you may want to turn the Range Checking and
Overflow Checking options back off; they seem to exact a performance hit
when left on.

I was apparently getting "silent" exceptions at run-time with the low
stack and overflow (array problem) conditions existing while the app was
run. I didnt even realize this, but my users sure did! They would keep
running reports and report and reports, and this puppy would leak
resources until a fatal GPF occurred including an occassional data loss
problem!  :-(

It all works fine now, and the app has ZERO resource leaks now!   :-)

HTH you.

Howard
p.s. Have you turn on "Break On Exception" in your Options/Environment
tab? This will let you see where your program is breaking and might give
you a clue as to the code that might be the culprit.
--
Howard Chandler, Jr.
Microsource Corporation
Software Engineers & Consultants
http://www.iglou.com/microsource
(606) 273-9741
--

Quote
Frank J. Zidar wrote:

> Hello all,

> I am currently using version 2.0J with Delphi version 1.0.  I am having
> problems printing my reports.  When I am in design mode and do a print
> preview and then print the report from there everything works fine and the
> report comes out on the printer and looks exactly as it should.  The problem
> occurs when I attempt to do the same thing in run-time mode from the .EXE
> file.  I click on the Print button and the Printing in progress dialog
> briefly appears.  As soon as it appears the program GPF's and exits back to
> Windows.  I have tried everything I could think of to fix the problem, but
> no matter what I do it always drops out.  Has anyone else experience this
> problem?

> Thanks in advance,
> Frank
> zid...@en.com

Other Threads