Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1680

Re: Addressing the printer -- Newbie

From "blank" <blank@blankety.blank.com>
Newsgroups comp.lang.java.help
References <4f6fbe47$1@dnews.tpgi.com.au> <jkq5vh$6br$1@dont-email.me> <4f720675@dnews.tpgi.com.au>
Subject Re: Addressing the printer -- Newbie
Date Wed, 28 Mar 2012 05:49:37 +1100
Lines 72
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6157
X-RFC2646 Format=Flowed; Response
NNTP-Posting-Host 220.245.83.181
X-Original-NNTP-Posting-Host 220.245.83.181
Message-ID <4f720bc8$1@dnews.tpgi.com.au> (permalink)
X-Trace dnews.tpgi.com.au!tpg.com.au 1332874184 220.245.83.181 (28 Mar 2012 05:49:44 +1100)
Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!mpls-nntp-01.inet.qwest.net!feed.news.qwest.net!mpls-nntp-05.inet.qwest.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!not-for-mail
Xref csiph.com comp.lang.java.help:1680

Show key headers only | View raw


Most of that was above my head...

I think it might be handy to show an actual example of how I currently print 
hard copy reports using VB6. This is an accounting program. The report in 
question lists particular transactions and shows them in columns. I have cut 
out all the code that does not relate to the printer

Printer.Orientation = vbPRORPortrait
aPageCount = 0
aLineCount = 0
'Report title and column headers here
For Looper = 1 to end of file
'get data from file here
    Aligned = Format(Looper, "###"): Printer.CurrentX = 20 - 
Printer.TextWidth(Aligned): Printer.Print Aligned;
    Printer.CurrentX = 33: Printer.Print TransactionCode;
    Printer.CurrentX = 48: Printer.Print TransactionDescription
    'various other columns
    'testing for page feed here
    aLineCount = aLineCount + 1
    If aLineCount > 56 Then
        Printer.NewPage
        '[Title and column header routine]
    End If
Next Looper

I am really looking for a simple example, such as how to align coulmns in 
Java and address the connected printer without having to specify it.

"blank" <blank@blankety.blank.com> wrote in message 
news:4f720675@dnews.tpgi.com.au...
> Thanks for that Knute...
>
> Takes me back to my own flying days in the UK in a Cherokee!
>
> But what an incredible amount of code when I can address the installed 
> printer with 2 lines of code in VB6!
>
> "Knute Johnson" <nospam@knutejohnson.com> wrote in message 
> news:jkq5vh$6br$1@dont-email.me...
>> On 3/25/2012 5:54 PM, blank wrote:
>>> Hi all
>>>
>>> I am a keen programmer in Visual Basic 6. I also tried Visual Basic 
>>> dot.net
>>> but was appalled at the lack of printer support in dot.net.
>>>
>>> I am thinking of learning Java, but would like to know if the language
>>> allows easy access to whatever printer is installed at a user site.
>>> Therefore I cannot specify the printer when writing the code and must 
>>> rely
>>> on the operating system to route data to the printer.
>>>
>>> Is writing reports to the printer (formatted and with columns and so on 
>>> as
>>> in VB6) practical? With vb6 it is as simple as printer.print!
>>>
>>> Thanks heaps
>>>
>>>
>>
>> For some sample code, look at the VFRFlightLog program here;
>>
>> http://rabbitbrush.frazmtn.com/aviation/index.html
>>
>> -- 
>>
>> Knute Johnson
>
> 

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Addressing the printer -- Newbie "blank" <blank@blankety.blank.com> - 2012-03-26 11:54 +1100
  Re: Addressing the printer -- Newbie "John B. Matthews" <nospam@nospam.invalid> - 2012-03-25 21:01 -0400
    Re: Addressing the printer -- Newbie "blank" <blank@blankety.blank.com> - 2012-03-26 15:25 +1100
      Re: Addressing the printer -- Newbie "John B. Matthews" <nospam@nospam.invalid> - 2012-03-26 09:24 -0400
  Re: Addressing the printer -- Newbie Roedy Green <see_website@mindprod.com.invalid> - 2012-03-25 20:32 -0700
  Re: Addressing the printer -- Newbie Knute Johnson <nospam@knutejohnson.com> - 2012-03-26 09:37 -0700
    Re: Addressing the printer -- Newbie "blank" <blank@blankety.blank.com> - 2012-03-28 05:26 +1100
      Re: Addressing the printer -- Newbie "blank" <blank@blankety.blank.com> - 2012-03-28 05:49 +1100
        Re: Addressing the printer -- Newbie Knute Johnson <nospam@knutejohnson.com> - 2012-03-28 09:34 -0700

csiph-web