How destroy a preview report object
-
- Posts: 76
- Joined: Wed Oct 12, 2005 5:52 pm
- Location: Milan,Italy
How destroy a preview report object
Hi,
if have:
report oRep preview
.
.
.
end report
.
.
i need later to destroy the preview (also to avoid a second prevew error)
i tried with
oRep:end() and also
oRep:oDevice:end() but them dont work !
Any help ?
Tks
Piscicelli/Zingoni
if have:
report oRep preview
.
.
.
end report
.
.
i need later to destroy the preview (also to avoid a second prevew error)
i tried with
oRep:end() and also
oRep:oDevice:end() but them dont work !
Any help ?
Tks
Piscicelli/Zingoni
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
I advice to define all objects (as all other program variables) as local (or static). After performing the general destroy method for most of objects (oObject:end()) assign NIL value to a object variable. I.e.
oObject:end()
oObject := NIL
I usually use the following command for the statements above
RELEASE OBJECT oObject
where OBJECT should be replaced with the specific class name
For example
RELEASE METER oMeter.
oObject:end()
oObject := NIL
I usually use the following command for the statements above
RELEASE OBJECT oObject
where OBJECT should be replaced with the specific class name
For example
RELEASE METER oMeter.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How destroy a preview report object
I think you would have to End() the preview window but its variable oWnd is static inside rpreview.prg. I don't think it's possible to do what you're asking for without modifying rpreview.prg.
EMG
EMG
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
In my turn I think that there is no matter how oWnd is declared. Either a new report object should (and indeed does) rerwite oWnd value or the end() method should assign it to NIL (I have not seen the source code; it is general remarks). If this is not the truth then class REPORT should be corrected.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How destroy a preview report object
I agree, but I don't think it is possible as TReport is today.
EMG
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
If you have created the TPreview object for yourself then try
EMG
Code: Select all
oPreview:oWnd:End()
Hello Enrico,
I tried your suggestion but it does not work.
> If you have created the TPreview object for yourself then try
no. PRINTER created the TPreview
I had a look into printer-class:
METHOD Preview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
RPreview( Self ), ::End() )
If I understand this right printer calls Rpreview and Printer is ended.
So there is no connection anymore to the event which called the Rpreview.
If you look into Property Inspector the Parent Window of Preview is the MainWindow of the application.
Regards,
Otto
I tried your suggestion but it does not work.
> If you have created the TPreview object for yourself then try
no. PRINTER created the TPreview
I had a look into printer-class:
METHOD Preview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
RPreview( Self ), ::End() )
If I understand this right printer calls Rpreview and Printer is ended.
So there is no connection anymore to the event which called the Rpreview.
If you look into Property Inspector the Parent Window of Preview is the MainWindow of the application.
Regards,
Otto
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Thank you Enrico.
That’s what I do now.
I changed printer.prg
printer.prg
DATA cFile
METHOD New( cDocument, lUser, lMeta, cModel, lModal, lSelection, cFile ) CONSTRUCTOR
METHOD ImportWMF( cFile, lPlaceable ) CLASS TPrinter
local hMeta, hOld, hWMF
local aData := PrnGetSize( ::hDC )
local aInfo := Array( 5 )
::cFile := cFile
and preview.prg
rprinter.prg
cTitle := ::oDevice:cFile
Now I have the title and with FindWindow() I will – I hope so –
get the handle.
Thanks again,
Regards,
Otto
That’s what I do now.
I changed printer.prg
printer.prg
DATA cFile
METHOD New( cDocument, lUser, lMeta, cModel, lModal, lSelection, cFile ) CONSTRUCTOR
METHOD ImportWMF( cFile, lPlaceable ) CLASS TPrinter
local hMeta, hOld, hWMF
local aData := PrnGetSize( ::hDC )
local aInfo := Array( 5 )
::cFile := cFile
and preview.prg
rprinter.prg
cTitle := ::oDevice:cFile
Now I have the title and with FindWindow() I will – I hope so –
get the handle.
Thanks again,
Regards,
Otto