Board index » delphi » My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox

My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox

I make my own preview window, and following the Help directives I put this
code in my report form.

---
procedure RepForm.MyReportOnPreviewEvent(Sender : TObject);
begin
  MyPrevForm.QRPreview.QRPrinter := TQRPrinter(Sender);
  MyPrevForm.Show;
end;
---

I can see the pages, change the zoom, etc.  Then I close the preview window,
but when I try to close the parent form... this don't close... the CLOSE
method has not effect.
If I don't use the preview, this form close correctly.
What is the problem? Have I to do something more before close my Preview
Form? May be free some component?

Thanks!

Greetings from Sky
[]---------------->>
Mail To: skyfight...@usa.net
[]---------------->>

 

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


On Tue, 13 Jan 1998 11:18:33 -0300, "SkyFighter1"

Quote
<skyfight...@usa.net> wrote:

i have the same problem .... it's because the parent form is modal,
isn't it ? it's a bug ... :((((((((((((((((
Quote
>I make my own preview window, and following the Help directives I put this
>code in my report form.

>---
>procedure RepForm.MyReportOnPreviewEvent(Sender : TObject);
>begin
>  MyPrevForm.QRPreview.QRPrinter := TQRPrinter(Sender);
>  MyPrevForm.Show;
>end;
>---

>I can see the pages, change the zoom, etc.  Then I close the preview window,
>but when I try to close the parent form... this don't close... the CLOSE
>method has not effect.
>If I don't use the preview, this form close correctly.
>What is the problem? Have I to do something more before close my Preview
>Form? May be free some component?

>Thanks!

>Greetings from Sky
>[]---------------->>
>Mail To: skyfight...@usa.net
>[]---------------->>

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


We also use our own previewer.  We have the same problem with closing
the parent form and have not yet found a solution.

I was wondering, though, if you might have some insight on what we might
be missing when we try to setup printer settings such as choosing print
ranges or printing "All" etc.  We can't seem to get those to work.  I
have tried using print dialog and other combinations of QRPrinter but
just can't seem to get the results I am looking for.

I either have to use QRPrinter.Print to print the whole thing or I don't
get any output at all.

Any help would be greatly appreciated.

Respectfully,

T. Schafer

Quote
SkyFighter1 wrote:

> I make my own preview window, and following the Help directives I put this
> code in my report form.

> ---
> procedure RepForm.MyReportOnPreviewEvent(Sender : TObject);
> begin
>   MyPrevForm.QRPreview.QRPrinter := TQRPrinter(Sender);
>   MyPrevForm.Show;
> end;
> ---

> I can see the pages, change the zoom, etc.  Then I close the preview window,
> but when I try to close the parent form... this don't close... the CLOSE
> method has not effect.
> If I don't use the preview, this form close correctly.
> What is the problem? Have I to do something more before close my Preview
> Form? May be free some component?

> Thanks!

> Greetings from Sky
> []---------------->>
> Mail To: skyfight...@usa.net
> []---------------->>

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


Same to me!

Grghgrgrgr ...

Gregor Ibic

Quote
SkyFighter1 wrote in message <69g4jd$ba...@forums.borland.com>...
>I make my own preview window, and following the Help directives I put this
>code in my report form.

>---
>procedure RepForm.MyReportOnPreviewEvent(Sender : TObject);
>begin
>  MyPrevForm.QRPreview.QRPrinter := TQRPrinter(Sender);
>  MyPrevForm.Show;
>end;
>---

>I can see the pages, change the zoom, etc.  Then I close the preview
window,
>but when I try to close the parent form... this don't close... the CLOSE
>method has not effect.
>If I don't use the preview, this form close correctly.
>What is the problem? Have I to do something more before close my Preview
>Form? May be free some component?

>Thanks!

>Greetings from Sky
>[]---------------->>
>Mail To: skyfight...@usa.net
>[]---------------->>

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


You have to free the preview windows and then the parent form will close!

--

Brad Evans

_|_|_|       R E A L T I M E     C O M P U T I N G
_|    _|      Quality Software, Service and Support
_|_|_|
_|    _|     Voice: +618 9481 0607   Fax:+618 9481 3162
_|    _|            Mailto:b...@rtime.com.au
                       http://www.rtime.com.au

Quote
>>I can see the pages, change the zoom, etc.  Then I close the preview
>window,
>>but when I try to close the parent form... this don't close... the CLOSE
>>method has not effect.
>>If I don't use the preview, this form close correctly.
>>What is the problem? Have I to do something more before close my Preview
>>Form? May be free some component?

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


Yes, that is true.  But the that implies recreate the preview every time I
show the preview form? Must be a better solution I hope...

Greetings of Sky
Argentina
[==========|>
E-Mail: skyfight...@usa.net
[==========|>

Brad escribi en mensaje <6arvm0$qp...@demeter.omen.com.au>...

Quote
>You have to free the preview windows and then the parent form will close!

>--

>Brad Evans

>_|_|_|       R E A L T I M E     C O M P U T I N G
>_|    _|      Quality Software, Service and Support
>_|_|_|
>_|    _|     Voice: +618 9481 0607   Fax:+618 9481 3162
>_|    _|            Mailto:b...@rtime.com.au
>                       http://www.rtime.com.au
>...

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


not to mention easily confused .free's and .create's - which is my
current problem...

it seems like the preview form is resetting the parent's modalResult - I
tried changing the modalResult of the preview with no problems, and
changing the main form to mrOk is fine - after the procedure however,
quickReports resets it to 0 somewhere (I don't have the source)...

freeing the preview form before changing the modal result works fine -
if only ONE preview was done...any more and exceptions occur (and it
eventually closes the form - not crashes)

when I tried different ways of freeing each preview, the program would
still give me exceptions when I tried to quit - it would let me click
close once (freeing the preview and setting modalresult to mrOk) and not
close the form...clicking again gave me an exception upon trying to free
the preview again!!

has anyone figured out how to get around this????

Tom

Quote
SkyFighter One wrote:

> Yes, that is true.  But the that implies recreate the preview every time I
> show the preview form? Must be a better solution I hope...

> Greetings of Sky
> Argentina
> [==========|>
> E-Mail: skyfight...@usa.net
> [==========|>

> Brad escribi en mensaje <6arvm0$qp...@demeter.omen.com.au>...
> >You have to free the preview windows and then the parent form will close!

> >--

> >Brad Evans

> >_|_|_|       R E A L T I M E     C O M P U T I N G
> >_|    _|      Quality Software, Service and Support
> >_|_|_|
> >_|    _|     Voice: +618 9481 0607   Fax:+618 9481 3162
> >_|    _|            Mailto:b...@rtime.com.au
> >                       http://www.rtime.com.au
> >...

Re:My own preview window - QuickReport V2.0J / Delphi V3.0 Pro / Paradox


hmmm...I just got it working with the following code
(keep in mind my (preview/report)calling form is a modal form called
from my main app -
I create the report form and preview form in the onshow)

procedure TfrmReportGenie.bbtnCloseClick(Sender: TObject);
begin
  Application.Handle := DLLAppHandle;  //obviously only applies to my
app

  frmPreview.Free;
  frmPreview := nil;

  frmReportGenie.ModalResult := mrOk;

end;

so far this seems to work in all cases:
 -  don't preview and close
 -  preview once and close
 -  preview multiple times (closing each preview) and then close
 -  preview multiple times (without closing each preview) and then close
 -  all of the above and close the main app (from sys tray) before
closing the preview or the modal form

hope this works for everyone!

Tom

Quote
SkyFighter1 wrote:

> I make my own preview window, and following the Help directives I put this
> code in my report form.

> ---
> procedure RepForm.MyReportOnPreviewEvent(Sender : TObject);
> begin
>   MyPrevForm.QRPreview.QRPrinter := TQRPrinter(Sender);
>   MyPrevForm.Show;
> end;
> ---

> I can see the pages, change the zoom, etc.  Then I close the preview window,
> but when I try to close the parent form... this don't close... the CLOSE
> method has not effect.
> If I don't use the preview, this form close correctly.
> What is the problem? Have I to do something more before close my Preview
> Form? May be free some component?

> Thanks!

> Greetings from Sky
> []---------------->>
> Mail To: skyfight...@usa.net
> []---------------->>

Other Threads