Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PCL PJL & ReportListener
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01032883
Message ID:
01033320
Vues:
23
>-> Email from Lisa
>
>Yes, you can do this. You need a combination of SYS(1037) and reportlisteners to do it.
>
>You have two main confusions here:
>
>1) Although it's technically/remotely possible to do so, you should not use PCL or PJL codes for this type of thing directly. For one thing, "???" instructions are a bit chancey under Windows -- having them work at all really "depends" on too many things -- in this case it won't work at all. You're just not talking to the right printjob.
>
>For another thing, you should be able to handle the operation in such a way that the user can set up alternative instructions -- or use a non-HP printer with the same results <s>. Also, the instructions might be quite a bit more complicated than you've described (the user could have other instructions besides paper bins). Anything that is available to a Page Setup dialog should be save-and-restorable, whether it is easily available from PCL/PJL or not.
>
>For all the reasons above, you should use SYS(1037) to save printing instructions, not printer language or escape codes.
>
>So... you can provide facilities for a user to do this, saving the results of his instructions into rows of a table. Or if you're really sure the same instructions will always work, they're never going to use a different printer... use SYS(1037) to save the correct instructions for each setup yourself and supply the table with the results with your application.
>
>You can restore these settings as needed -- either to use in the "standard" VFP printing environment, using SYS(1037), or into a specific print job, as you need to do here.
>
>2) Using NOPAGEEJECT is ordinarily how you tell VFP to continue multiple reports into one print job, yes. But in your case, you're only getting access to the one set of print job instructions that VFP pays attention to, when it initializes that first report. After that, with NOPAGEEJECT, it's just not listening.
>
>(I'm not sure if I'm being clear. Your use of ??? in between REPORT FORM commands -- or even SYS(1037) used after a REPORT FORM... NOPAGEJECT to restore a different setup -- would not be not affecting the reserved print job that VFP already has going. Do you see how this works?)
>
>So, instead of letting VFP handle the print job, you should use a reportlistener (ListenerType 3) to cache the full report output and then use OutputPage to send the pages to a print job handle you construct yourself. Adjust the hDC, in between your OutputPage instructions, with the help of the saved setup instructions you've saved into a table using SYS(1037).
>
>You could cache the multiple reports using NOPAGEEJECT and one listener, but I would recommend against it -- unless you know exactly how many pages there will be in each report, so you know exactly when to adjust the print instructions. There's no reason to try to figure it out at runtime.
>
>Just use multiple report listener instances, one to cache the pages for each report. They can be instances of the baseclass -- just use ListenerType 3 for each one and you're all set.
>
>I wrote a full example of this process for DevCon Advisor this year, having been asked about it the year before.
>
>You may re-post this response in UT if you wish. If you do, please do so in full.
>
>>L<
>
>
>
>>Lisa,
>>
>>Is it possible in 9.0 to:
>>
>>Create a print job
>>send PCL or PJL codes to set up the job for an output bin & stapling option
>>
>>print a report in landscape mode from tray 4
>>print a report in portrait mode from tray 3
>>print a report in portrait mode from tray 2
>>print a report in portrait mode from tray 4
>>
>>end the print job so the printer will stack & staple the job
>>
>>
>>I've tried using code like the following but no luck all reports are in landscape mode and all come from the same tray....
>>
<snip>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform