Normal Topic [Solved] Create multiple outputs from 1 rec. (Read 325 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
[Solved] Create multiple outputs from 1 rec.
Dec 14th, 2007 at 10:35pm
Print Post Print Post  
I have a line items database that generates a report that is used for production purposes.
The report tells how many pieces need to be made for each product sold. The report works well for production purposes.

I would also like to generate a sheet that would be included in each item built. The sheet  would have the productID in a human readable barcode, the product name, the invoice number it was built for and some additional cosmetic junk. I can presently  generate the sheets exactly how I want for each line item record I have in the database, my problem is that a line item has a quantity on it, say the quantity is 5, I need to generate 5 sheets for this line item. How should I go about doing this?

Do I use file I/O commands or post to write out the lines and then read them in to another database or ??

Thanks
« Last Edit: Dec 18th, 2007 at 1:12am by Hammer »  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: How should I create multiple outputs from 1 re
Reply #1 - Dec 14th, 2007 at 10:39pm
Print Post Print Post  
Make a subroutine that generates the sheet for the line item.
Call the subroutine in a for loop from 1 to n where n is the quantity.

Code
Select All
var vQty as Int
var vLoop as Int

    vQty = Quantity
    For vLoop = 1 To vQty
	  PrintSheet()
    Next
 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: How should I create multiple outputs from 1 re
Reply #2 - Dec 17th, 2007 at 10:32pm
Print Post Print Post  
Your simple solution works Awesome Smiley

I had know idea how simple it was to loop through the records. I have now started doing all sorts of neat things using this technique.

Thank you so much for all the help.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged