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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing in LaserJet & in DotMatrix ?

Status
Not open for further replies.

ramani

Programmer
Mar 15, 2001
4,336
AE
I am just revisiting to my FPD2.6 days in memory lane. I used to create reports using FPD2.6 report designer and often most of the accounts reports spread to 132 columns. (No specific printer drivers were involved). However, user has the choice to select in the printer panel a compressed mode i.e. 17CPI nearabout and print in A4 or 8.5"x11" paper in a compressed character printout. This gave a lot of advantage to the users. I had even provided a Printer Driver application made out in FPD2.6, which they use even today to set Laser printers of various models to print in compressed mode and so, the reports were done in laser also. So in a nutshell... the user had the choice to select compressed or 12 CPI or 10 CPI mode and roll out the reports on the paper size of their choice.

The current VFP reports are done differenly. Either they are compressed and sent to A4 sheets or they are sent to dot matrix. Whichever way, the paper size is specified in the report itself. The fonts are specified also. So Windows handles it differently. The user has lost his choice.

Is there any easy way by which, the various fields placed in the report can be readjusted to suitably provide the users with a choice.. Compressed mode.. or 12CPI mode .. or 10CPI mode.. and allowing them to use different paper sizes
with the same report form.

What I can think of is to hack my Printer Report file and recomputer the Vpos, Hpos fields to the proportionate values. This can be the approach, if I proceed to do this as of now.

Now I leave to other friends here to suggest if there is any better methods or any code sharing, if possible and if they have accomplished the same in a successful manner. I dont want third party solutions without source code (I cannot ask for spending as well) and prefer to have my own source code so that the future charting is with me.

Thanks in advance for your time. ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I remember poking printer codes directly to the printer to hack something for a customer back in my Fox 2.6 days...been rooting around for the code, can't find it as of yet...as for the font it is held in the fontname field but then you already probably know that...and printer codes are imperfect solution since they can differ between makes and models Slighthaze = NULL
 
ramani

Do you only have two possibilities? Can you create two reports and depending on the user's choice, select the appropriate report? I think hacking is a viable option, but very non-visual, it will take a lot of trying to achieve the right position of the fields. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first or check this link
 
Slightaze, I am talking about VFP reports printing in 10 CPI or 17 CPI or 12 CPI.. allowing the printer to compress the report line as a whole based on what has been selected on the printer panel, say of a dot matrix printer for example. Thanks for reading my long note.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Ramani,

I am saying instead of letting VFP Report/Windows send the printer codes across the wire you can poke some in the bit stream going to the printer yourself to change settings...here's a little cross section of some EPSON Printer Codes that set Print Size and Character Width

Decimal ASCII Description
15 SI Select condensed mode
18 DC2 Cancel condensed mode
20 DC4 Cancel one line double width mode
27 14 ESC SO Double width for one line (duplicate)
27 15 ESC SI Select condensed mode (duplicate)
27 77 ESC M Select elite width (12 cpi)
27 80 ESC P Select pica width (10 cpi)
27 87 48 ESC W 0 Cancel double width mode
27 87 49 ESC W 1 Select double width mode

...anyways, just thought i might clarify a bit Slighthaze = NULL
 
I understand what you mean Slighthaze. But that wont work, since the codes are sent often at individiul field elevels.. such as Bold, underline etc..

If you have positioned the field1 at 10th Col and field2 at the 25th Col, VFP will output these fields at the said Cols only. Whereas, I am talking about proportionately placing them on the report based on the overall situation.

We have the proportionate sizing of fonts in Forms display. I have for example implemented for all forms, a custom class, wherein... based on users resizing of the form.. all the fonts will go a proportionate adjustement to their font size and place themselves suitably, so that the user will see a nice viewing effect. None of the controls will go hiding or aligned in odd way. Same way, I want a proportionate adjustment to their fonts and also relative placements in reports. This is what I am thinking to achieve. :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
That's a really cool idea...some type of height and width ratio for reports based on paper selection...I get it now...are you talking about compiled reports or for free standing FRX files? Slighthaze = NULL
 
i'm thinking this should be a fairly straightfoward process on free standing frx file once you have ascertained the paper ratios...you'd have to have them hardcoded or a table of the on which to go...keep the original width and height and font and then multiply by the ratio for width, height, and fontsize...delete TAG, TAG2 and comment out settings adverse in EXPR...wow this is a really neat idea Ramani...did you come up with this yourself back in the day or did you see it in another application somewhere? Slighthaze = NULL
 
Hi slightaze,

I already have a routine to capture all the print report files captured as a sigle table and included in the project. It has many advantages.
1. When I want a modification for only one user who wants the report in a slightly different way, I copy the specific report file to the user. So the method operandi.. is to check for a report file in harddisk.. if present.. copy it to a temp report file ... else.. extract from my table and create the temp report file.. strip the printer driver dynamicaly .. close the file.. shoot the report... and delete the temp report file..
2. It helps to extract and create the report file on the user computer at my will by clicking a button. So the reports are just few seconds away, but still hidden.
3. Alow user to modify reports at their will and use it. If they get into trouble.. they can initialise that from the stored table to default values.
and such advantages.
4. Again it is so handy, that I only have one table holding all the printer reports records counting to few thousands.

Now I am thinking of a dynamic routine to not only strip the Printer driver but to do as above as well, based on requirement.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
it's a very nice set up Ramani and i like that idea about dynamic sizing based on ratio...i'll let it muddle around in my head for awhile, good stuff Slighthaze = NULL
 
=prtinfo(5) return the factor by which printed output is scaled.

If the scale is changed, the output will be scaled.
Am I right? If yes, we can dig into this flag to find more.

Norman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top