Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing Reports to a Remote Dir
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00501471
Message ID:
00505310
Views:
26
>>>>>I am currently printing a few hundred reports(via DO...WHILE loop) to a remote directory (\\REMOTE\temp\) for printing at a later time. The remote machine is running Win98 and the directory is shared. The problem I have is that, until I access the directory thru Windows Explorer, the reports are "pretending" to print, but never make it there. As soon as I open the folder the reports immediately start being created. Has anyone else seen this?
>>>>You can try to create a temp file before you do printing:
>>>>lcPath = "\\Remote\temp\"
>>>>lcTempName = SYS(2015)
>>>>=strtofile("Testing", lcPath + lcTempName)
>>>>Erase (lcPath + lcTempName)
>>>>
>>>>Maybe it will help.
>>>
>>>Nope, that didn't work. The temp file was never created in the remote directory.
>>
>>You can try to map remote directory to a local name.
>>It can be done dynamically using WSH
>>
>>oNet = CREATEOBJECT("WScript.Network")
>>oNet.MapNetworkDrive("Z:", "\\REMOTE\temp\")
>>* Do printing to Z:\filename
>>oNet.RemoveNetworkDrive("Z:")
>
>That worked, but why? Is there a way to tell which drive letters are already used, so I can pick one that is for sure not used? Thank you for your help.

Code below will list all network drives.
You can modify it to find out wich letter wasn't used yet.
oDrives = oNet.EnumNetworkDrives()
? "Network drive mappings:"
For i = 0 to oDrives.Count - 1 Step 2
    ? "Drive " + oDrives.Item(i) + " = " + oDrives.Item(i+1)
Next
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform