Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using DBI-Tech's ctSchedule & MSFTs PageSet.Dll
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Using DBI-Tech's ctSchedule & MSFTs PageSet.Dll
Miscellaneous
Thread ID:
00899107
Message ID:
00899107
Views:
83
I am using DBI-Tech's ctSchedule control to show scheduling info in a gantt chart. The DBI control does not allow for programmatic control of printer settings. So every time the schedule is printed, the user has to select the printer, the orientation, and the paper size.

DBIs website recommends using MSFTs PageSet dll to control orientation and this is the example syntax on the site:
Dim obj As PageSet.PrinterControl
Private Sub Command1_Click()
      Set obj = New PrinterControl
      obj.ChngOrientationLandscape
      ctSchedule1.PrintSchedule
      obj.ReSetOrientation 'This resets the printer to portrait.
End Sub
Have added something similar to my VFP form:
WITH thisform.ctSchedule1
   .PrintColumns = 3
   .PrintTitle = "Project Schedule"
   .PrintTimeDistance = 15

   SET PRINTER TO "\\server1\Copier"
   RELEASE oPrint
   oPrint = .NULL.
   oPrint = CREATEOBJECT("PageSet.PrinterControl")
   oPrint.ChngOrientationLandscape

   .PrintSchedule    && send to printer

   oPrint.ReSetOrientation 
   RELEASE oPrint
   oPrint = .NULL.
ENDWITH

but when it gets to the "ChngOrientationLandscape" command, it errors with:
OLE IDispatch exception code 0 from PageSet: Subscript out of range..
Have tried to passing parameters (.t., 1, 0, ...) but nothing works. I think this is due to not having admin rights on the network to manipulate the printer, and the error msg is a bit misleading. But was curious if anyone encountered something similar or new a workaround.
Next
Reply
Map
View

Click here to load this message in the networking platform