Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing detail on preprinted forms 1

Status
Not open for further replies.

bosk00

Technical User
Mar 5, 2004
91
US
I am trying to print to preprinted state forms. This is 2 part question with both parts tying togeather. Between an input form and a query I am able to get the records that I need to print. The state form can be 1 or more pages, which is determined by the amount of records returned. If there are only 1 or 2 records they should print on the first page. If there are more records additional pages are all able to handle 7 records each. ie page 2 records 3-10, page 3 records 11-17 etc.
First part. I created a report and have placed the text boxes in the locations that they need to be in to print in the correct place. One of the fields is name. I set the upper fields data source to name, and it shows the correct data. If I set the lower data fields data source to name, what I get is both fields showing the same record. I get the second record on a second page 1, with both upper and lower showing the second record. How would I set the lower field for the 2nd record.
Second part. How would I add in the second page and only print it if needed.

Thanks in advance


Alan
Senility at its finest
 
You might try creating two reports. The first would be set up so the first record would print in the proper places on the first page and, if there is a second record, it also prints in the correct place on the form. (You've probably already done this.)

Then I would create a second version of the report that handles the additional pages that will contain more than two records.

Your printing procedure would require that you count the number of records to print, then either just print the (first) one or or two records or, if there are more than two records, print the remainder using the second version of the form. Hopefully there is something in the records that changes enough that you can easily separate the first two records from the remainder if there are more than two to be printed.

The other problem is trickier: how to print on the correct form. If you are using a multi-tray print you need to include on each report definition the tray which it will use as the paper source.
 
Thanks for the response. I see where you are going with the second page, I think that I'm set there. For the sake of argument, lets just deal with a one page report. I have worked out the positioning of the text boxes on the report. Call them upper and lower. The first record prints in the correct place in upper. How do I designate the data source for the lower boxes for the second record? If the source is set the same as the upper I get the same record not the next record.

Alan
Senility at its finest
 
Each report should only define the printing for one record (in the details area). Just make sure the spacing is correct so that when two records are printed (on the page one report) they are printed in the correct places on the form. Same thing with the second version of the report (that prints any additional pages). That way it will print one or two records on page one, and the remaining records will be printed on whatever number of additional pages are needed. You just need to pay attention to the record spacing and the size of the report's header and footer to be sure it prints correctly (for the second version of the report).
 
A little fuzzy, but I think I follow. The first report would contain the appropriate form header information and the detail of the first record. A second report spaced to print in the correct location would only contain the detail for the second record.
Where I am lost, how will I get 2 reports to print on one page, what will stop the page from ejecting between the reports, or is this a case of a master report and the (record one) and (record two) reports being sub reports?

Alan
Senility at its finest
 
Try doing this just as a test:

Set up a separate report (you can use the same source table) something like this:

(header data)


(detail)
controls to print data from fields




If you run this, the detail section will repeat for each record. This is how you end up with multiple records printed. (I'm assuming that the data for each record on the form is the same set of data.)
 
You are correct I did get all the data printed on a single page. I can line up the first record and get it to print where I want it, but how do I control the location that the second record prints at?

Alan
Senility at its finest
 
It's controlled by the size of the detail area. Be sure that you have set the cangrow property of all controls to no, otherwise the height of the record printed can vary depending upon the height of controls that can grow when printed.

This is no different than when printing, say, something like address labels (3 columns of 10 in each column). Just requires accurate design of each record's printing.
 
Thank you for your help. Your answer and patience are much appreciated. A much deserved star.

Alan
Senility at its finest
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top