Code Comments
Programming Forum and web based access to our favorite programming groups.Is it possible to print data in columns using only native PC_... routines ? The known problem is the shifting of a column to the left or right according to the data of the previous column. Is it any way to avoid this problem ? I would appreciate any idea. Note. I want to avoid using tools such as RPV, CobView, TurboReports etc. Yiorgo Terzis.
Post Follow-up to this messageYiorgo Terzis wrote: >Is it possible to print data in columns using only native PC_... routines ? >The known problem is the shifting of a column to the left or right >according to the data of the previous column. >Is it any way to avoid this problem ? >I would appreciate any idea. >Note. I want to avoid using tools such as RPV, CobView, TurboReports etc. > > >Yiorgo Terzis. > > > > If Donald's answer of going fixed font is your solution - go for it. But I'm getting kind of leery about answering questions like yours, without more specific detail. Somebody asked a question, I thought I gave him a neat solution. Not so. He is Italian and his reply, "Sorry James. My English is not good. I'm talking about the Data File Editor". Had I known it *was* the DFE - I wouldn't have attempted to answer - I've never used it ! Assuming you want more info - go to Micro Focus site and sign up for Answer Exchange (freebie) and post your question under Net Express. But *PLEASE* be specific - illustrate what your current problem is., say, some sample print lines. Using PC-PRINT it is possible to use different styles, fonts *all* in one line. Jimmy, Calgary AB
Post Follow-up to this messageYiorgo Terzis wrote: > Is it possible to print data in columns using only native PC_... > routines ? The known problem is the shifting of a column to the left > or right according to the data of the previous column. > Is it any way to avoid this problem ? > I would appreciate any idea. > Note. I want to avoid using tools such as RPV, CobView, TurboReports > etc. I'm sure it's possible but the horror of it all! Assuming (easy way) you have to build one line in memory. To do so, you've got to know where the second label begins - in linear measure. With a fixed font, this is trivial. With a proportional font, well: 1. You've got to know the width of the first column, so you've got to sum the proportional widths of all the characters making up the printable area. 2. Then you must insert sufficient spaces (knowing the width of a space) to get yourself to the beginning of column two. 3. As a bonus, the various character widths are not the same from font to font. For example, an "e" may be 2/3rds the width of "w" in one font and 3/5ths the width in another font. 4. You must be precise in the above calculation. An error of 1/10 mm looks wretched. Suggestions: 1. Use a fixed-width font. The postal service recommends a fixed-width font and all capitals for mailing labels anyway (speeds automation). 2. Use a label printer that only prints one column.
Post Follow-up to this messageYiorgo Terzis wrote: > Is it possible to print data in columns using only native PC_... routines ? > The known problem is the shifting of a column to the left or right > according to the data of the previous column. > Is it any way to avoid this problem ? > I would appreciate any idea. > Note. I want to avoid using tools such as RPV, CobView, TurboReports etc. > > > Yiorgo Terzis. > > Just go to a fixed size font. Donald
Post Follow-up to this messageLX-i wrote: > James J. Gavan wrote: > > [snip] > > > > You need an autoresponder. I think DD might have one - you could > change the "please do your own homework" to "please go to Micro Focus > and sign up for Answer Exchange". ;) > > I agree Daniel it gets a bit tiresome typing it each time - for the life of me, why don't M/F do a mail out telling folks Answer Exchange exists. You really need to go there for specifics, and just like the others, oodles of examples they can point you at.. Example - I just asked, "The Animator (debugger) shows a Hex value for any objects created for OO, (i.e. the Hex Value is the object reference or 'pointer').. While the Animator is great, in this particular instance, (no pun intended with last word), I would have liked to do a DOS screen display to see if the objects matched - I got an answer, haven't tried it yet, but at least I'm not bamboozled. What's an auto-responder ?. Allow for my age - you are still in the cusp of youth. Wait until Mommy USAF doesn't look after you when you get out into the big wide, wide world. :-) Jimmy, Calgary AB
Post Follow-up to this messageJerryMouse wrote: > Yiorgo Terzis wrote: left TurboReports > > I'm sure it's possible but the horror of it all! > > Assuming (easy way) you have to build one line in memory. To do so, you've > got to know where the second label begins - in linear measure. > > With a fixed font, this is trivial. With a proportional font, well: > > 1. You've got to know the width of the first column, so you've got to sum > the proportional widths of all the characters making up the printable area. > > 2. Then you must insert sufficient spaces (knowing the width of a space) to > get yourself to the beginning of column two. > > 3. As a bonus, the various character widths are not the same from font to > font. For example, an "e" may be 2/3rds the width of "w" in one font and > 3/5ths the width in another font. > > 4. You must be precise in the above calculation. An error of 1/10 mm looks > wretched. > > Suggestions: > 1. Use a fixed-width font. The postal service recommends a fixed-width font > and all capitals for mailing labels anyway (speeds automation). > > 2. Use a label printer that only prints one column.
Post Follow-up to this message"Stephen Gennard" <stephen.gennard@someone.somewhere.at.a.m.focus.company.co m> wrote > If you have to use a proportional font, you could separating the columns in > your report with a tab (0x09). <shudder> Tabs are no solution when proportional fonts are in use. They will either be interpreted as a number of spaces (and thus are no benefit versus spaces), or they will go to the next fixed point if that can be set somehow. The problem then is 'which is the _next_ position'. ie if positions are at 10, 20, 30 then if the first colum takes up 8 (because it is a few 'i's) the next is 10, if it takes 12 (because it is a few 'w's) the next is 20. Still no consistency.
Post Follow-up to this messageAn auto-responder will scan your incoming mailbox and issue responses depending upon the content of the message. The simple example is the vacation deamon. Turn it on and any incoming mail generates a response to sender "I'm sorry, Jimmy is out for 3 days. But your message is important, will contact when I return, yada, yada". You would need one that could scan for the string "How do I" and change the response text to "contact answer exchange". In article <byPWc.207529$J06.107311@pd7tw2no>, "James J. Gavan" <jjgavan@shaw.ca> wrote: <snip> > > What's an auto-responder ?. Allow for my age - you are still in the cusp > of youth. Wait until Mommy USAF doesn't look after you when you get out > into the big wide, wide world. :-) > > Jimmy, Calgary AB
Post Follow-up to this message? "James J. Gavan" <jjgavan@shaw.ca> ?????? ??? ?????? news:irLWc.198225$M95.197768@pd7tw1no... > Yiorgo Terzis wrote: > ? > If Donald's answer of going fixed font is your solution - go for it. But > I'm getting kind of leery about answering questions like yours, without > more specific detail. Somebody asked a question, I thought I gave him a > neat solution. Not so. He is Italian and his reply, "Sorry James. My > English is not good. I'm talking about the Data File Editor". Had I > known it *was* the DFE - I wouldn't have attempted to answer - I've > never used it ! > > Assuming you want more info - go to Micro Focus site and sign up for > Answer Exchange (freebie) and post your question under Net Express. But > *PLEASE* be specific - illustrate what your current problem is., say, > some sample print lines. Using PC-PRINT it is possible to use different > styles, fonts *all* in one line. > > Jimmy, Calgary AB Thank you both for your replies. I do not want to restrict printings only to fixed font. I am developing a program from which, among others, the user will design the form of labels to print. The problem is to left align labels of a second or third column. Any case, I will try with Microfocus site. Thanks.
Post Follow-up to this messageYiorgo Terzis wrote: >Is it possible to print data in columns using only native PC_... routines ? >The known problem is the shifting of a column to the left or right >according to the data of the previous column. >Is it any way to avoid this problem ? >I would appreciate any idea. >Note. I want to avoid using tools such as RPV, CobView, TurboReports etc. > > >Yiorgo Terzis. > > > > Bill - I see you refer him to John at Wimbledon for spc - but note he says above he doesn't want to use RPV, Cobview or TurbReports - my guess $$$$ - what's a rough price tag for spc ? Yiorgo, Have you tried Answer Exchange yet - haven't seen anything from you. Just a wild guess - are you trying to do something with ticketing for retail, pre-printed labels say 4 or 8 across the page ? If it is retail, then you may well have to go googling looking for folks who specialize in ticketing. If it's not that, exactly what are you doing that is causing you this alignment problem ? Donald's approach is closest. Here's what I do using PC_PRINT. - my reports are landscape in condensed giving roughly a line capacity of 187 characters. - Naturally I want header data to look a bit different from the text. - I use a different font for the header from the detail lines. Surprisingly, two fonts, the combination looks better than sticking with one font ! - I can manipulate the header going bold, larger etc. do a 'Pause' and then change to something else. - my individual print lines, and sub-total lines are set in particular styles or fonts - but I retain that format for detailed lines, or total-lines as appropriate. I have no problem with alignment. It's sometime since I did it - so I'm a bit vague. I think I *may* have had a problem with alignment - say I wanted something like :- this-is-the-description ........zz.zzz.........zz.zzz..... etc. The dots/periods are spaces. I can't recall, but I may have had problems with those numerics - so instead of the line above, I substituted the following :- this-is-the-descriptionzzzzzzz.zzzzzzzzzzz.zzz..... etc. I expanded the numeric fields to include intervening spaces. As I say quite a while since I did it, so not absolutely sure. I can only guess at what is happening above - seeing that Stephen jumped in, perhaps he can confirm. Each of those 'z's' has the same width/pitch, whatever, and regardless of whether or not it contains a character to print, picks up on the anticipated width for printing (????). But it works. Any help ? Jimmy, Calgary AB
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.