Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call to print or preview from the same button
Message
From
04/01/2021 06:33:44
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01677711
Message ID:
01677736
Views:
63
>Hi,
>
>I am working on a program that consists of a grid. That is it, the program is just one grid. In this grid the user will see all work orders assigned to him/her. One of the columns of the grid will allow the user to print any of the work orders in the grid.
>But sometimes, a user does not want to print but simply a view the order; in a report preview format. And the key is that I don't want to have two button - that is to take two columns - one for print, one for preview. In my initial test, I do the preview by using the doPDF driver installed on my PC. So, by choosing this driver, I can view without printing. But I do not want to "force" the customer to install a doPDF or some other driver that allows to convert a print to a PDF.
>Instead I want all the functionality be in the program.
>
>I can add a small menu, when user clicks on this button that will ask if user want to Print or Preview.
>
>So, my question, how else would you suggest having both Print and/or Preview in one button of the grid?
>
>TIA

I previous application of mine I had similar issue. What I did was had the print button Print when clicked, but Previewed when the CTRL key was pressed when the Print button was clicked.
PROCEDURE ShiftState
    DECLARE INTEGER GetKeyState IN user32 INTEGER nVirtKey
    LOCAL nBit AS INTEGER
    nBit = 0
    nBit = IIF(BITTEST(GetKeyState( 0x10 ),8),BITSET(nBit,0),nBit)		&& shift
    nBit = IIF(BITTEST(GetKeyState( 0x11 ),8),BITSET(nBit,1),nBit)		&& ctrl
    nBit = IIF(BITTEST(GetKeyState( 0x12 ),8),BITSET(nBit,2),nBit)		&& Alt
    RETURN nBit
ENDPROC

PROCEDURE button.Click
      IF BITTEST( ShiftState(), 1)
            * Preview
      ELSE
           * Print
      ENDIF
ENDPROC
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform