FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PREVIEW shows BELOW the dialog
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
PREVIEW shows BELOW the dialog
Posted: Fri Oct 04, 2013 11:04 PM
When I want to print data I have a button "Print" on my dialog.
When the print with PREVIEW shows, it is shown BELOW the dialog and I can still see the dialog!?
usin g FWH 13.04
Here is the sample:
Code (fw): Select all Collapse
function Print_TEst()

   LOCAL oPrn, oFont, oIni, oPrinter

   PRINTER oPrn PREVIEW

      DEFINE FONT oFont NAME "Times New Roman" SIZE 0,-12 OF oPrn

      PAGE

    
      oPrn:CmSay(  2.1,   16, "19960001")             // invoice
      oPrn:CmSay(  4.3,  1.7, "Computer Associates")  // company name
      oPrn:CmSay(  5.5,  1.7, "Somewhere in U.S.A.")  // adress
      oPrn:CmSay(  7  ,  1.7, "0001")                 // reference
      oPrn:CmSay(  7  ,  4.2, "Software consulting")  // description
      oPrn:CmSay(  7  , 18.5, "0")                    // price
      oPrn:CmSay( 16  , 18.5, "0")                    // total

      ENDPAGE

      PAGE

      #ifdef __CLIPPER__
         oPrn:ImportWMF( "Invoice.Wmf" )
      #else   
         oPrn:ImportWMF( "Invoice.emf" )
      #endif   

      oPrn:CmSay(  2.1,   16, "19960002")              // invoice
      oPrn:CmSay(  4.3,  1.7, "Microsoft Corporation") // company name
      oPrn:CmSay(  5.5,  1.7, "Somewhere in U.S.A.")   // adress
      oPrn:CmSay(  7  ,  1.7, "0002")                  // reference
      oPrn:CmSay(  7  ,  4.2, "Another test")          // description
      oPrn:CmSay(  7  , 18.5, "0")                     // price
      oPrn:CmSay( 16  , 18.5, "0")                     // total

      ENDPAGE

   ENDPRINT

   oFont:End()

   MsgInfo( "Work done!", "Look at your printer" )

return nil


The problem is that the preview windows is not ON TOP of all other windows
What can I do please?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: PREVIEW shows BELOW the dialog
Posted: Sat Oct 05, 2013 12:45 PM
Hello,

I think during printing, the DIALOG is not needed.
The easy way, just include :

FUNCTION PRINT_TEST(oDlg)

oDlg:Hide()

....
....

ENDPRINT

oFont:End()

MsgInfo( "Work done!", "Look at your printer" )

oDlg:Show()

return nil

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: PREVIEW shows BELOW the dialog
Posted: Sat Oct 05, 2013 02:10 PM
Boris

Add the PREVIEW MODAL to your code when you define the print object ..

Code (fw): Select all Collapse
PRINTER oPRINT FROM USER       ;
      PREVIEW MODAL


This forces the report viewer to stay in focus and wait for the user to print or close.

Rick Lipkin
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: PREVIEW shows BELOW the dialog
Posted: Sat Oct 05, 2013 02:16 PM

Uwe,
unfortunately this doesn't help. The Preview window is NOT modal and therefore the line oDlg:Show() is reached immediately after the preview is shown... :(
There must be some change in PRINTER.PRG or RPREVIEW.PRG but I don't know where and what.

Also the preview window does not even cover the previous main screen completely below. This way the part of the main screen is visible with the main menu options (check the image I included above)

The preview in REPORT class works ok
I badly need help because I wanted to deploy the app on Monday/Tuesday but I cannot do it with this wrong preview..

Anyone?
Antonio, give me a hand please.

Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: PREVIEW shows BELOW the dialog
Posted: Sat Oct 05, 2013 02:21 PM

Rick,

THANK YOU, this is the solution!

I am on this and previous forum many, many years and there was ALWAYS the help when anyone of us need it.
Good to be in such company!

Thanks again Rick and Uwe for your time

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: PREVIEW shows BELOW the dialog
Posted: Mon Oct 07, 2013 09:06 AM

Boris,

Yes, you have to use the MODAL clause as Rick explained.

Sorry for my answer delay :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: PREVIEW shows BELOW the dialog
Posted: Mon Oct 07, 2013 03:22 PM

Don't worry Antonio, I know you will be around when needed :)

Continue the discussion