Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

ChrisMc (Programmer) (OP)
15 Jul 03 12:30
I'm converting a legacy app to Windows and part of the requirement is to print existing multi-part forms on a matrix printer.  I'm using the Generic Text-only driver for both speed & compatibility.

The report designer needs a page layout and here's my problem: my forms are 4 inches by 10 3/8 inches (or 102mm by 265mm if you prefer) and there is no layout anywhere near.  I thought I'd just assign standard fanfold and let it print, but when the print routine gets to (what it assumes is) the end of page, it skips a few lines (presumably skip over perforation).  If I set the form to the nearest I can get (envelope size 10) it page ejects at the end of each form.

I've been experimenting -
SCAN NEXT 100
    ? <A Field>
ENDSCAN
again results in a page eject at just after the page length.  I need to effectively print continuously and count lines for formatting OR find some way of entering a page length and width directly into the report.

Any ideas would be extremely welcome.

Thanks in advance
ChrisMc
jrbbldr (Programmer)
15 Jul 03 12:53
Most often the "skip over perforation" is a hardware setting within the printer itself - often controlled by a DIP switch setting somewhere on the printer.

This can sometimes be turned off programatically using the specific printer's Programming Control Language (PCL)

As to output layout, you can continue to hardcode it using the ? & ?? method, or the @Row,Col method.  
Or you can use Foxpro's Label Designer to create a new label to the needed dimensions.  
Or, lastly, you can work with Foxpro's Report Designer and set the layout to Landscape orientation with a defined total number of lines per "page".  If you use this check to see that the layout's Eject Before Printing and Eject After Printing are set as you want.

Good Luck,

JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com

ChrisMc (Programmer) (OP)
16 Jul 03 1:43
Firstly, thanks for the interest.

You're right that skip over perf is a printer setting but it's not the case here - it's off.  In the legacy (DOS) app, the printer is selected with SET PRINTER TO and the layout printed with ?/?? and/or @ Row,Col on the same printer I'm using for the development - no problem.  

I can't use this method on a Windows program as it is a multi-user app and workstations would need CAPTURE commands to enable the printer commands to be vectored to the correct device - SET PRINTER TO LPT2 would be fine if it were a local printer but not with a network printer.  I know I could use the alternative format of the command,\\MACHINE_NAME\PRINTER_NAME =, but I've then got to integrate that with the normal Windows method of selecting a printer - messy!

Good idea about the Label Designer but again it uses predefined layouts stored in Foxuser.  Looking at the structure of the FRX and LBX files, for OBJTYPE = 1 fields HEIGHT and WIDTH should be the ones I want, but in a FRX file they hold 0 and -1 respectively.  In a LBX file they seem to hold the label size - VPOS holds 3, HEIGHT 937 and WIDTH 25000 for a label defined as 3 x 7 on an A4 sheet - I presume 937 is the label height in what pixels???  I suppose I can eventually work out the convertion from mm to pixels by defining different sized labels and looking at the result.

It's your last point however which intrigues me - how do you define a total number of lines per page in the Report Designer?  This would be the solution to my dilema but it's not a function I've ever seen.  Can you help further with this?

Again, many thanks for the assistance.
Chris
jrbbldr (Programmer)
16 Jul 03 9:20
First - Label Printing "Label Designer uses predefined layouts stored in Foxuser"

You can open an existing Label using MODIFY LABEL <some name> and then modify its layout - Rows, Width, Labels across, Labels down the page, etc.  Re-Name it in Remarks and then, from the top menu Label | Layout - Save the new layout as your own new layout.

So you are not limited to ONLY the pre-defined Foxpro layouts.

Next - Report Designer - Changing page layout

Create a new report or modify an existing one with MODIFY REPORT <some name>.  Go to the top menu Report | Page Layout
In here you set the Page Length and Page Width (a.k.a. Right Margin Column).  In the Options screen accessed through that same parameter page you set the Page Eject Before Printing and Page Eject After Printing.

Just an FYI concerning - "I can't use this method on a Windows program as it is a multi-user app and workstations would need CAPTURE commands to enable the printer commands to be vectored to the correct device - SET PRINTER TO LPT2 would be fine if it were a local printer but not with a network printer."

Actually you can use this method if it works for you.  I have had to do it for some client legacy applications and it worked OK.  You may have good reasons not to do so, but it will work by setting up different network printer queues each associated with a separate virtual LPT port and then allowing the user and/or the program to select which Printer causing the appropriate SET PRINTER TO LPTn.

Good Luck,

JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com

ChrisMc (Programmer) (OP)
16 Jul 03 10:31
Hi again; Sorry, don't know your first name so can't be as friendly as I would like<g>

You're using FP for DOS.  My query is FP for Windows.  The steps you describe only occur in FPD (although you CAN change the right margin of a label layout).

Having said that, I wonder how much detail I will lose if I transport to FPD, make the changes as you describe & then transport back???  I'll give it a go and see what transpires.

Thanks again,
Chris
ghunaima (Programmer)
17 Jul 03 2:15
Remove @ .. SAY commands from the program & use ? orr ?? instead as @ .. Say commands normally skip lines for perforation
jrbbldr (Programmer)
17 Jul 03 8:49
My apologies for assuming that your "legacy" application was in FPD.

For the "report" layout....

In FPW you should still be able to use the LABEL approach.
Pick one of the "standard" labels.  Then go into the top menu's Report | Page Layout and set to 1 column.  Continue in that screen on to Print Setup and change to Landscape orientation.   
Return to the main Label Designer screen and change the height of the Detail & Page Footer bands.  Finally do a Save As...  to retain your own label settings.   
Then within your program do a  LABEL FORM <name>... to utilize your new Label.

For the network printer access....

The previous comments still apply.

Good Luck,

JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com

ChrisMc (Programmer) (OP)
18 Jul 03 5:58
I have done a lot of testing with this problem and these are the results, in the hope that it may assist anybody else also tearing their hair out.

You can define the layout of your report/label anyway you want, but if the paper size defined for the installed printer is different to that of the report/label, it wont work.  

I naively thought that the paper size I had selected in the report/label layout would be passed to the printer driver but this is NOT the case.  Example:  my label layout is 4 inches deep.  I define the paper used as German fanfold which is 12 inches long and therefore get 3 labels per page.  Page preview shows a layout of 3 labels per page exactly as I want, but when printed it only works correctly if I also change the page size to German fanfold in the properties of the installed printer.

As I need both US standard fanfold for some reports and German standard fanfold for others I will have to have two printer driver installations – not the end of the world but an irritation.

Anybody not as naive as me is probably falling about laughing over this one, but there you go.

ChrisMc

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close