Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keyboard command to send a report to the printer

Status
Not open for further replies.

Foxprosoldier

Programmer
Nov 5, 2004
7
CA
This is faq184-4480
============================
If you are not happy with the toolbar that controls the report preview screen, why not build your own? This FAQ does not give step-by-step instructions for creating a toolbar, but it will give you an idea of what code to put in the Click events of some of the buttons.

The following code should go in the various page navigation buttons:

KEYBOARD "{PGDN}" && next page
KEYBOARD "{PGUP}" && previous page
KEYBOARD "{HOME}" && first page
KEYBOARD "{END}" && previous page

To open the "Go to page" dialogue:
KEYBOARD G

To jump to a particular page, add the page number and the Enter key to the above command, for example:
KEYBOARD "G9{ENTER}" && go to page 9

And finally, to toggle the zoom factor:
KEYBOARD "Z"

You can't mimic the full functionality of the built-in toolbar, but with the above code, you can get most of the way there.
====================

Anyone know the keyboard command to use for the print button (send the report to the printer) for such a toolbox?

 

Foxprosoldier,

No, sorry but there is no keystroke that will do exactly what you want to do. (Mike, CTRL+P won't work in the situation that Foxprosoldier described.)

The only thing I can suggest is that you set up on ON KEY LABEL that launches a REPORT FORM command. I've not tried that, and can't be sure that it will work, but it is worth experimenting.

If you find a solution, let me know and I will update the FAQ.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
??? MyString will send a string to the printer bypassing the printer driver.

Regards,

Mike
 

Mike,

??? MyString will send a string to the printer bypassing the printer driver.

That's true, but if I've understood the question right, Foxprosoldier wants to mimic the Print button on the toolbar, not bypass the printer driver.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Yes the ctrl+p did not work for vfp 9.0. Not sure for earlier releases but did not try with a version before vfp 9.0

I got around it by creating a toolbar with one button on it that set a public variable to a value that meant something to the calling program and then clicking the
Print button on the regular Print Preview toolbar with the code below.

FOR nCount = 1 TO _SCREEN.FormCount
IF UPPER(_SCREEN.Forms(nCount).Name) = "PREVIEWTOOLBAR"
= _SCREEN.Forms(nCount).cmdprint.click()
EXIT
ENDIF
ENDFOR
 

Foxprosoldier,

I can see how that would work, but I thought the aim was to use your own toolbar in place of the built-in one. Doesn't your solution require the built-in toolbar to still be present?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top