Re: Crash Program Problem
Tom Nesler <[email protected]> Mon, 15 Apr 2002 06:42:34 -0700 (PDT)
| Newsgroups | gmane.comp.lang.delphi.quick-reports |
|---|---|
| Message-ID | <[email protected]> |
Hi Todd! --- todderamaa <[email protected]> wrote: > We have a laptop that we use in the office and for demonstrations. A > problem started occurring whenever we tried to view a print preview > when the laptop wasn't on the network. As soon as we attached to the > network the report would function properly. > > We found the problem to be that the default printer for the laptop > was a network printer. As long as the printer was available the > report > was fine but as soon as the printer wasn't available we had a crash. > We changed the default printer to be a fax printer and everything > works fine (on or off the network). > > We have also had issues with our application where every once in a > while the app crashes when they view a report. We believe that in > the these instances, for some reason, the printer isn't available when > they try to preview a report. > > Is this a known problem? > Are we doing something wrong? > Is this a problem with C++ Builder 4.0, Quick Reports or Windows? > Is there a known 'work around' for this problem? You are correct that a printer definition needs to be available when previewing a QR. This is because the main premise of previewing a report is that it is supposed to simulate what the paper report will look like. If no printer is listed, QR doesn't know what to simulate. There are probably more details needed in order to determine exactly what is causing these crashes. Can you put your calls to the preview method inside a Try..Except block? I have never done this myself so I don't know if it helps or not. There are also some calls you can make through the windows API to test if there is a default printer or if the printer is available. You might try doing some testing before you begin your report routine. Hope this helps, ===== Tom Nesler Live Long...Code Well... and Prosper! V __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/