1. Report Printing under windows

Firstly thanks to David for resolving the Tab printing problem. Now, I
would like to print some fancy reports under windows. To start with I would
like to print a Listview with all the headers etc... How do I do this ? Do
I need to calculate all the positions of the columns and then put the text
in the printer (like we did in good ol days with COBOL) or there is any
other easy way of doing this under windows in EU?

Regards,
Prasanta.

new topic     » topic index » view message » categorize

2. Re: Report Printing under windows

Hello Prasanta,

Thursday, November 09, 2000, 11:44:07 PM, you wrote:

PC> Firstly thanks to David for resolving the Tab printing problem. Now, I
PC> would like to print some fancy reports under windows. To start with I would
PC> like to print a Listview with all the headers etc... How do I do this ? Do
PC> I need to calculate all the positions of the columns and then put the text
PC> in the printer (like we did in good ol days with COBOL) or there is any
PC> other easy way of doing this under windows in EU?

PC> Regards,
PC> Prasanta.

Try with this:

include win32lib.e
constant
    Win   = create( Window, "List", 0, Default, Default, 200, 220, 0
    ), -- create window
    List1 = create( List, "", Win, 10, 10, 120, 140, 0 ) -- create
    list

procedure when_load()

    -- build the list
    addItem( List1, "one" )
    addItem( List1, "two" )
    addItem( List1, "three" )
    addItem( List1, "four" )
    addItem( List1, "five" )
    addItem( List1, "six" )
    addItem( List1, "seven" )
    addItem( List1, "eight" )
    addItem( List1, "nine" )
    addItem( List1, "ten" )

end procedure

onOpen[ Win ] = routine_id( "when_load" )
WinMain( Win, Normal )

Best regards,
 Crow                            mailto:3anmagudi at infovia.com.ar

new topic     » goto parent     » topic index » view message » categorize

3. Re: Report Printing under windows

Sorry! I forgot to mention. I have already created the list on screen. Now
I need to dump it on a printer (all those wysiwyg printing thinge..).
Has anyone got any idea?

Regards,
Prasanta.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Report Printing under windows

>Sorry! I forgot to mention. I have already created the list on screen. Now
>I need to dump it on a printer (all those wysiwyg printing thinge..).
>Has anyone got any idea?
>
>Regards,
>Prasanta.


I did a program to print invoices for the company I work for.
Ended up building a bitmap and printing it. Havn't got the bmap
printing code handy right now, but Wolf Fritz helped me with it,
I think he'll have a copy. Printing text is quicker, but for a fancy
report a bitmap is much more flexible.

Regards

Graeme Burke
Brisbane

new topic     » goto parent     » topic index » view message » categorize

5. Re: Report Printing under windows

Unfortunately you have to do all the hard work yourself. Even under VB this
is true. The main reason is that the paper dimensions and the screen
dimensions are invariably different, as is the way that fonts and lines are
rendered. You have to do all the math to convert relative positions. Also,
what looks good on screen might not on paper. The screen font sizes and
paper font sizes are usually different to get the same readiblity. There are
even more subtle differences as well, like sans-serif fonts are better for
screens and serif fonts are better on paper. The thickness of lines on
screen is in integal pixel sizes but how wide is a pixel in inches? That
depends on the monitor. How many ink dots are there in a pixel? That depends
on the printer resolution. None of these things can be safely hard-coded
either. You must get run-time metrics from the system and do the conversions
yourself.

The easiest way of getting a listbox to show up on paper, is converting it
to a bitmap and dumping that out to paper. But even this is not a trival
exercise.

Of course, if GUI is not important, then just treat the report in standard
COBOL fashion, except that you have to draw a page then print it - you are
not working with line printers anymore.

-----
cheers,
Derek Parnell
derekp at solace.com.au
Solace Limited ( http://www.solace.com.au )
Melbourne, Australia
+61 3 9291 7557

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu