Setting Printer Options Through ObjectPal 
Author Message
 Setting Printer Options Through ObjectPal

I have made a form with a button. I want my users to just press the
button & that will:

1) Run a Query (and it does)
2) Set the Printer to Landscape mode (Not a chance!)
3) Print the report based on the Query (yep!)
4) Set a flag to True (Yep and Yep again!)

At this point I would settle for anything approching a reasonable
solution to Step #2
Here are some of the things I have tried to no avail:

A) menuAction(menuFilePrinterSetup) This wouldn't actually change the
printerSetup, but it does call the setup dialog box.
However, choosing Landscape does not change the orientation. The Report
still prints Portrait.

B) The solution I am really aiming at that I feel would make this a much
more user-friendly form. I will post the code following
this brief comment. I don't really understand when to use the term
"Landscape" vs "prnLandscape" or "Orient" vs "Orientation"
That may be where this code is messing up. It all works with no error
messages at all, but it still prints in Portrait.

Please help me!
Sincerely, Cathy Hendricks

Here it is:

if not executeQBE(depositQ) then
 msgStop("Table Generation Error","Could not Execute Query to produce
Report. Call your System's Administrator!")
else
 siNCopies=2
 prnOptions.copies=siNCopies
 prnOptions.Orientation=prnLandscape
 If printerSetOptions(prnOptions) then
  depositRept.open("depstslp",WinStyleMaximize)
  depositRept.print(prnOptions)
  depositRept.close()
  If depositTC.open("Thsyrdst.db") then
   depositTC.home()
   depositTC.edit()
   PrintDeposit=True
   while not depositTC.eot()
    message("All Deposits have been Reported: True!")
    depositTC."Slip Printed" = PrintDeposit
    depositTc.nextRecord()
   endwhile

   depositTC.close()
   message("All entries have been reported on Deposit Slips")
   beep()
  else
   msgStop("Error opening Thirsty Data","Call your System
Administrator")
  endIf
 else
  msgStop("Printing Error:","Printer Options not set correctly, Call
Your System Administrator")
 endIf
endIf

Again, Thanks for your help!



Fri, 26 May 2000 03:00:00 GMT
 Setting Printer Options Through ObjectPal

Cathy,

Try this:
Var
   pmmenu1 popupmenu
   whichreport string
   arPrinters Array[] string
   rpi  PrinterOptionInfo
EndVar

;Make a popup menu asking how they want it printed
   pmmenu1.addstatictext("I will print the confirms sorted by...")
   pmMenu1.addSeparator()
   pmmenu1.addtext("Account")
   pmmenu1.addtext("Security")
   pmmenu1.addtext("Currency")
   setmouseshape(mouseuparrow,true)
   whichreport = pmMenu1.show()
   setmouseshape(mousewait,true)

;Get a list of the available printers to print to and make it a popup
   enumPrinters(arPrinters)
   pmMenu.addStaticText("Where do I Print them...?")
   pmMenu.addSeparator()
   pmMenu.addArray(arPrinters)

   setmouseshape(mouseuparrow,true)
   strChoice = pmMenu.show()
   setmouseshape(mousewait,true)
   if strChoice <> "" then
      printerSetCurrent(strChoice)
   endIf

;set to landscape
   rpi.Orientation = prnLandscape
   printerSetOptions(rpi)

      switch
         case whichreport="Currency" : r.print("Confirms by Currency")
         case whichreport="Security" : r.print("Confirms by Security")
         case whichreport="Account" : r.print("Confirms by Account")
      endswitch

;Empty the array, in case you hit it again
   arPrinters.empty()
   pmmenu.empty()
   pmmenu1.empty()

Good Luck
Paul



Mon, 29 May 2000 03:00:00 GMT
 Setting Printer Options Through ObjectPal

On Mon, 08 Dec 1997 16:19:01 -0600, Cathy Hendricks

Quote:

>I have made a form with a button. I want my users to just press the
>button & that will:

>1) Run a Query (and it does)
>2) Set the Printer to Landscape mode (Not a chance!)

See my reply to Mark Puchalski, "Pdox 5.0/Reports"  The code works for
Pdox7 as well.  Changing orientation has been a trick, but it's not
too bad, really.

Scott



Tue, 30 May 2000 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. ObjectPAL printer options?

2. ObjectPal Printer options

3. Setting Printer Options etc.

4. Setting Printer Options

5. Setting printer options in a script

6. Q: how to change printer settings/options

7. How do you set printer to a network printer

8. FPW2.6 printing to network printer w/SET DEVICE TO PRINTER

9. set printer to \\machine name\printer

10. ObjectPal printer control

11. How to select printer in Objectpal

12. Selecting Printer and Tray in ObjectPAL


 
Powered by phpBB® Forum Software