<div> Thanks for the email Brian -- and for the stuff on your site - I actually went in a little bit different direction on this.</div>
<div> </div>
<div> Basically, I downloaded reptmail and am creating a script that will run after these specific reports run.</div>
<div> I have the report printing to a file now, then I'm using reptmail to email it to recipients and then removing the file afterwards.</div>
<div> </div>
<div> I still have other considerations I'm making on some things, so that's all whiteboard stuff for me to figure out first but I'm </div>
<div> headed in the right direction. I also downloaded your ghostpdl so I can convert the report file to pdf in the event we have</div>
<div> any client requirements that would rather have pdf attachments instead.</div>
<div> </div>
<div> So far so good in my testing - I have used both reptmail and pcl2pdf smoothly this morning - now I'm just doing some</div>
<div> scripting and figuring out which reports, etc I'm going to run thru one of these scripts or the other......pretty cool stuff you've</div>
<div> done - thanks a ton!!!</div>
<div> </div>
<div> I will advise if I need any more 'steering in the right direction' with what I'm doing.......</div>
<div> </div>
<div> Thanks again</div>
<div> </div>
<div> Scott<br><br></div>
<div class="gmail_quote">On Thu, Nov 4, 2010 at 3:10 PM, Brian K. White <span dir="ltr"><<a href="mailto:brian@aljex.com">brian@aljex.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On 11/4/2010 12:07 PM, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> wrote:<br>> I am trying to diminish some of the paper we're using here and am trying to<br>> divert certain reports, etc to be printed to a file rather than printed to a<br>
> printer.<br>><br>> This is my first attempt at doing this, so forgive my ignorance to a degree<br>> ha<br>> In looking at the filePro manual, you should enter:<br>><br>> printer file "/tmp/output"<--- as path to where you want the output<br>
> directed to<br>> printer reset<---- to reset all printer functions back to where they<br>> started before processing started<br>><br>> So, I have a report called recap for a file called PDMbal<br>><br>
> So, in output processing for 'recap', I do one simple looking to grabt the<br>> value of a dummy field<br>><br>> Then: lookup sta = filename k=16 i=A -nx<br>> Then: aa(4,allup)=sta(2)<br>><br>
> Then: printer file "/tmp/output"<br>> Then: printer reset<br>><br>> It DOES create /tmp/output, however it appears all it captures in that is<br>> the print code hex values or something....<br>> If I look at the output of /tmp/output, using vi:<br>
> ^[%100^[(10OU^O^[E<br>><br>> The actual report then does print (kind of) to my system default printer,<br>> but prints it in 2 pages, the first page looks normal like it should,<br>> then it prints the 2nd record on a 2nd page, with much larger print<br>
> type....(there are only 2 records on this report, and when printed<br>> 'normally' it prints both records out in condensed print style just as I've<br>> asked it to.<br>><br>> I also even tried putting the printer commands above in a -v processing<br>
> table, but that had no effect and I got the same results.<br>><br>> What am I missing here???<br>><br>> BTW this is SCO OpenServer 5.0.5 w/filePro 5.6.07R4<br><br></div></div>There are some differences between clerk & report, so talking report<br>
only here.<br><br>Assuming you want to control the filename dynamically from processing<br>(meaning, using the command line arguments would be inconvenient)<br><br>You're probably best off putting -p /dev/null -pc nocodes on the command<br>
line<br>(to prevent any printer init codes or anything at all from going<br>anywhere before you reach the point in processing where you've set a<br>filename)<br><br>Then in processing, in @once, do<br><br>@once:<br>x = rand("-1")<br>
of = /tmp/@fi{"_"{getenv("LOGNAME"){"_"{rand(){".pcl"<br>printer file of<br>printer type "hplaser"<br>end<br><br>Ideally you should also dispose of the file before exiting if possible,<br>
just to keep things self contained.<br><br>@done:<br>printer flush<br>printer reset<br>to = "<a href="mailto:someone@somewhere.com">someone@somewhere.com</a>"<br>system "emailscript < to < of<br>x = remove(of)<br>
end<br><br>Also, if you don't do it this way, you'll have to work around<br>permissions problems which I've avoided here by ensuring 3 things agree<br>with each other.<br>1) since I allowed fp to create the file with "printer file ...",<br>
and 2) since the external command that uses the file only needs to<br>_read_ it,<br>and 3) I used fp again to delete the file with remove() (not say, an rm<br>command in the system command).<br><br>If you wanted to run the report to file and then not use the file until<br>
after exiting rreport, then you don't need anything in the @done. No<br>printer reset, no system, no remove().<br><br>In the above example, the only reason I have the printer reset there is<br>because you have to have at least a printer flush to ensure the data is<br>
all written to the file before some other process tries to read the<br>file. Preferably a printer reset which actually releases all hold on the<br>file.<br><br>A lot depends on what you want to do with the file at the end.<br>
Do you want to write it to a permanent archive directory tree that users<br>can browse later at will? How, by http? cgi? direct samba file share access?<br>Do you want to email it or ftp it somewhere?<br>Do you want to display it to the users screen on the spot and don't want<br>
to keep it any longer than necessary to get it into their web browser or<br>pdf viewer?<br><br>That last is probably the most useful in most cases. We do _all_ our<br>printing that way and it's great. But to do that relaibly and<br>
conveniently you need to set up some things at the system level to make<br>things possible, even easy, in filepro. That would be a whole email by<br>itself.<br><br>--<br><font color="#888888">bkw<br></font>
<div>
<div></div>
<div class="h5">_______________________________________________<br>Filepro-list mailing list<br><a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br></div></div></blockquote></div><br>