<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
John Esak wrote:
<blockquote cite="midJIECJPPMJGMIINMGGNGAIEPAOFAA.john@valar.com"
type="cite">
<blockquote type="cite">
<pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:filepro-list-bounces@lists.celestial.com">filepro-list-bounces@lists.celestial.com</a>
[<a class="moz-txt-link-freetext" href="mailto:filepro-list-bounces@lists.celestial.com">mailto:filepro-list-bounces@lists.celestial.com</a>]On Behalf Of Dave
Burris
Sent: Tuesday, August 23, 2005 6:00 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:filepro-list@seaslug.org">filepro-list@seaslug.org</a>
Subject: Output processing, lookups, and system calls
Hello,
filePro v5.0.11D4 on OpenServer 5.0.6
I have a report that prints invoices to a file in ascii and then runs a
system call to convert the file to pdf format. However, if I run a
lookup and getnext command prior to running the system call to create
the pdf file, the system call fails. If I comment out the lookup and
getnext commands, the system call succeeds and the pdf is created. Is
there are rule about using lookups in output processing?
Below is the code with the lookup and getnext command. It iterates
through each invoice line item and prints out the taxable items.
Thanks,
Dave Burris
taxitms:'Retrieve the taxable line items and print them::
::lookup items = kwb_invoice_line_item k=1 i=E -nx:
:not items 'No hardware or software:return:
::gosub taxitem:
:'Print the materials subtotal:gosub mater:
::pt="":
::return:
taxitem:'Iterate through and print the taxable items only::
:not items:close items; return:
:items(2) ne 1:close items; return:
:items(9) eq "N" 'Only print the taxable items:getnext items;
goto taxitem:
:'Set the variables and print:pt=items(3)&" "&items(5)&" "&items(4)&"
"&items(6):
::print:
:items(11) ne "" 'If shipping & handling exist, print an indented
line:pt=" SHIPPING "&items(11); print:
::getnext items; goto taxitem:
</pre>
</blockquote>
<pre wrap=""><!---->
Dave,
I looked at your code and see nothing wrong with it. There are two "not
items" lines when you could do this more easily with just one. Also, you do
the subroutine without first checking to see if you have a record which
needs the subroutine. You *do* check in the subroutine to see if items(2) ne
1, but you could do this just below the first "not items" and have things
read a little more clearly. In other words, there is no reason to use the
"taxitem" subroutine, the getnext code would accomplish what you want
without it. However, I think this code would still work... So, I think
there is some other problem going on.
</pre>
</blockquote>
Thanks for the advice John. I will clean it up.<br>
<blockquote cite="midJIECJPPMJGMIINMGGNGAIEPAOFAA.john@valar.com"
type="cite">
<pre wrap="">Meaning, if this code were being done in *clerk, the PRINT would function as
I think you expect it to work here. Otherwise, if you are running this in
*report as you say, the PRINT might give you some strange results. I think
what you would want to be using in this case is FORM. I don't think the
PRINT command is meant to be used more than once in output processing.
Could be wrong about this, maybe, but I think this is where the problem
lies.
</pre>
</blockquote>
I am running this code from *report. The strange thing is that the
ascii file is generated correctly every time. The pdf file is also
generated correctly when there are no lookup and getnext commands that
run. I walk through the code and watch the system command run, but no
pdf file is created. If I run the same command from the command line,
the pdf is created ok, and if I re-run the report for an invoice with
no invoice items (just time entries so the above lookup returns no
invoice items), the pdf is created successfully. It is like filePro
fails to execute the command completely, but I see no error. The
system command is:<br>
<br>
::system "/appl/fp/text2pdf"<if<br>
<br>
<br>
</body>
</html>