PREVIEW shows BELOW the dialog

PREVIEW shows BELOW the dialog

Postby codemaker » 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: Select all  Expand view

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?
Image
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: PREVIEW shows BELOW the dialog

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: PREVIEW shows BELOW the dialog

Postby Rick Lipkin » Sat Oct 05, 2013 2:10 pm

Boris

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

Code: Select all  Expand view

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: PREVIEW shows BELOW the dialog

Postby codemaker » Sat Oct 05, 2013 2: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.
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: PREVIEW shows BELOW the dialog

Postby codemaker » Sat Oct 05, 2013 2: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
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: PREVIEW shows BELOW the dialog

Postby Antonio Linares » Mon Oct 07, 2013 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: PREVIEW shows BELOW the dialog

Postby codemaker » Mon Oct 07, 2013 3:22 pm

Don't worry Antonio, I know you will be around when needed :)
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests