printing a group of records (fixed)
Dan Snyder
dan at macdatatech.com
Tue Jan 31 13:10:46 PST 2006
Thanks for all the responses. The solution was to add "-bg -bs" to the
command string. Pressing "P" locks the record until the @keyP processing
finishes. The "-bg" runs the system command in the background, so the
processing completes, unlocks the record and then the system command runs in
the background after the record has been unlocked.
My command string now looks like this:
system "/appl/fp/dreport shipping -f packlist -v packlistsel
-a -u -bg -bs -r"<18
Thanks again!
Dan Snyder
IT Manager
Mercury Electronics
717-854-9557 ext.224
-----Original Message-----
From: Nancy Palmquist [mailto:nlp at vss3.com]
Sent: Tuesday, January 31, 2006 12:59 PM
To: Dan Snyder
Cc: filepro-list at lists.celestial.com
Subject: Re: printing a group of records
Dan Snyder wrote:
> Hello everyone,
>
> I'm trying to improve some of our old filePro files/applications.
> I've run into a printing problem that is common across many of these
> files and I was hoping someone can point me in the right direction.
>
>
> Example Situation
> ----------------------
> We have a "shipping" file that stores both header and detail
> information in one record. To create a packing list with multiple
> line items we have to create multiple records. Then to print the
> packing list, we have to exit out of the current record and screen and
> go all the way back to the main filePro menu. Then select "D -
> Request Output", select "shipping", load a saved selection set, then
> update the selection set with the proper packing list number.
>
>
> Goal
> -----
> I understand that the best solution would be to redesign the
> application from scratch as two separate files one for the header and
> one for the details. However, I don't have time to do that. Right
> now, I'd just like to improve efficiency by simplifying printing so
> that when a user is in the shipping file, looking at a record, they
> could press "P" and have the packing list print. The programming
> would have to grab the packing list number from the current record,
> select all records with that packing list number and print the
> "packlist" output. Sounds simple, but this filePro novice can't get it to
work.
>
>
> Attempted Solution and Problem
> --------------------------------
> I tried the following command in a @keyP section of the input
> processing table.
> system "/appl/fp/dreport shipping -f packlist -v packlistsel -a -u
> -r"<18
> This seems to work, meaning it selects the proper number of records
> for the packlist number on the current screen. The problem is that it
> locks up at generating output. By hard coding the -r value I found
> that it only locks up when you are looking at the record you want to
> print. For example: If you are looking at packing list #2 and the
> script is hard coded to print packing list #3 it prints fine.
> However, if you are looking at packing list
> #3 and the script is hard coded to print packing list #3, it locks up
> at generating output.
>
> Can anyone tell me what I need to do to keep it from locking up?
>
>
> Selection table packlistsel
> ---------------------------
> aa = @PM
> if 18 eq aa
> select
> end
Dan,
You are locking a record that is necessary for the output to print. The -u
will cause it to ignore "file locking" but record locking is still repected.
If you do not change any data, you can run it readonly -ro on the menu line.
Since you have to start this from @key or in the input processing, it will
always lock the current record.
The tricks people might use would be to start your system call from @entsel,
or @menu logic.
My preferred trick would be to create the report using forms in the current
file.
Picture your packing slip as having 3 parts. Headings (10 lines of stuff),
detail section (1 line) print as many as necessary, totals (10 lines).
Create three forms.
formm "header"
formm "detail" 'put data in the data fields, and repeat once for each line.
(You will have to send enough of these to fill the center of the form, maybe
40 if the header and footer are each 10 and the form needs to be 60 lines)
form "footer"
By using the form command you are closing the print job. The formm version
will allow each form sent to append.
I have a version of this that has a form that is one line long and has
one variable at the left edge.
*aa
Then I can put something in that variable, do a formm "oneline", and
repeat until I have generated the form I want. Remember to finish with
a FORM command to close the print job.
It can do anything.
The FORM and FORMM commands work in *clerk only. In *report, you use
print but the form names can not vary as easily.
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list