<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&#39;m using reptmail to email it to recipients and then removing the file afterwards.</div>
<div> </div>
<div>  I still have other considerations I&#39;m making on some things, so that&#39;s all whiteboard stuff for me to figure out first but I&#39;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&#39;m just doing some</div>
<div>  scripting and figuring out which reports, etc I&#39;m going to run thru one of these scripts or the other......pretty cool stuff you&#39;ve</div>
<div>  done - thanks a ton!!!</div>
<div> </div>
<div>  I will advise if  I need any more &#39;steering in the right direction&#39; with what I&#39;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">&lt;<a href="mailto:brian@aljex.com">brian@aljex.com</a>&gt;</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>&gt; I am trying to diminish some of the paper we&#39;re using here and am trying to<br>&gt; divert certain reports, etc to be printed to a file rather than printed to a<br>
&gt; printer.<br>&gt;<br>&gt; This is my first attempt at doing this, so forgive my ignorance to a degree<br>&gt; ha<br>&gt; In looking at the filePro manual, you should enter:<br>&gt;<br>&gt; printer file &quot;/tmp/output&quot;&lt;--- as path to where you want the output<br>
&gt; directed to<br>&gt; printer reset&lt;---- to reset all printer functions back to where they<br>&gt; started before processing started<br>&gt;<br>&gt; So, I have a report called recap for a file called PDMbal<br>&gt;<br>
&gt; So, in output processing for &#39;recap&#39;, I do one simple looking to grabt the<br>&gt; value of a dummy field<br>&gt;<br>&gt; Then: lookup sta = filename k=16     i=A   -nx<br>&gt; Then: aa(4,allup)=sta(2)<br>&gt;<br>
&gt; Then: printer file &quot;/tmp/output&quot;<br>&gt; Then: printer reset<br>&gt;<br>&gt; It DOES create /tmp/output, however it appears all it captures in that is<br>&gt; the print code hex values or something....<br>&gt; If I look at the output of /tmp/output, using vi:<br>
&gt; ^[%100^[(10OU^O^[E<br>&gt;<br>&gt; The actual report then does print (kind of) to my system default printer,<br>&gt; but prints it in 2 pages, the first page looks normal like it should,<br>&gt; then it prints the 2nd record on a 2nd page, with much larger print<br>
&gt; type....(there are only 2 records on this report, and when printed<br>&gt; &#39;normally&#39; it prints both records out in condensed print style just as I&#39;ve<br>&gt; asked it to.<br>&gt;<br>&gt; I also even tried putting the printer commands above in a -v processing<br>
&gt; table, but that had no effect and I got the same results.<br>&gt;<br>&gt; What am I missing here???<br>&gt;<br>&gt; BTW this is SCO OpenServer 5.0.5 w/filePro 5.6.07R4<br><br></div></div>There are some differences between clerk &amp; 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&#39;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&#39;ve set a<br>filename)<br><br>Then in processing, in @once, do<br><br>@once:<br>x = rand(&quot;-1&quot;)<br>
of = /tmp/@fi{&quot;_&quot;{getenv(&quot;LOGNAME&quot;){&quot;_&quot;{rand(){&quot;.pcl&quot;<br>printer file of<br>printer type &quot;hplaser&quot;<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 = &quot;<a href="mailto:someone@somewhere.com">someone@somewhere.com</a>&quot;<br>system &quot;emailscript &lt; to &lt; of<br>x = remove(of)<br>
end<br><br>Also, if you don&#39;t do it this way, you&#39;ll have to work around<br>permissions problems which I&#39;ve avoided here by ensuring 3 things agree<br>with each other.<br>1) since I allowed fp to create the file with &quot;printer file ...&quot;,<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&#39;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&#39;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&#39;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>