Skip to main content

[JAVA2D] Printing/Viewing report

3 replies [Last post]
Anonymous

Hello,

I have data records which I would like to extract and
print as neat report document.

can one tell me how I can create a document like say
ms word which distributes records on page and then let
me view/print pages.

I have dot matrix printer TVSE MSP 145. old one!

I assume I cannot populate jtable and print it. I
would need to handling priting in code. For simple
reports I guess html will be better option as its easy
to generate markup compared to do drawing on canvas.

Miten.

__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miten mehta

Hello,

I tried stream printing in ps mode to file.

JTable.PrintMode.NORMAL does not seem to print
multiple pages for table if table does not fit in a
page. I believe FIT_WIDTH should not as it scales.

I can set row height but my reason was to wrap text
for table cell. It does not wrap text. Autowrap
Jlabel or table cell feature has not made it to jdk1.5
release.

Even if I set TableColumnModel and have cell render I
suppose while printing it will still be unused.

Miten.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Phil Race

Since it sounds like you have a data set which can be tablulated
- ie entered into a JTable then it *CAN* be as simple as
"populate jtable and print it"

JDK 1.5 now directly supports that.
See the 1.5 docs for javax.swing.JTable.print(..)

> I have dot matrix printer TVSE MSP 145. old one!

Umm. So long as the windows drivers support it, it'll work
to some degree but it will have to work with the limited
resolution of that device.

-phil

miten mehta wrote:
> Hello,
>
> I have data records which I would like to extract and
> print as neat report document.
>
> can one tell me how I can create a document like say
> ms word which distributes records on page and then let
> me view/print pages.
>
> I have dot matrix printer TVSE MSP 145. old one!
>
> I assume I cannot populate jtable and print it. I
> would need to handling priting in code. For simple
> reports I guess html will be better option as its easy
> to generate markup compared to do drawing on canvas.
>
> Miten.
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Check out the new Yahoo! Front Page.
> www.yahoo.com
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

miten mehta

Phil,

I think some how user should be able to code such that
he can validate next row to print. Like one might
want to insert page break depending upon some
criteria, change headers etc.

I would like to change font of text and wrap text in
cells rather than it getting clipped so that may be
reports look more customized.

I shall give default printing a shot.

Miten.

--- Phil Race wrote:

> Since it sounds like you have a data set which can
> be tablulated
> - ie entered into a JTable then it *CAN* be as
> simple as
> "populate jtable and print it"
>
> JDK 1.5 now directly supports that.
> See the 1.5 docs for javax.swing.JTable.print(..)
>
> > I have dot matrix printer TVSE MSP 145. old one!
>
> Umm. So long as the windows drivers support it,
> it'll work
> to some degree but it will have to work with the
> limited
> resolution of that device.
>
> -phil
>
> miten mehta wrote:
> > Hello,
> >
> > I have data records which I would like to extract
> and
> > print as neat report document.
> >
> > can one tell me how I can create a document like
> say
> > ms word which distributes records on page and then
> let
> > me view/print pages.
> >
> > I have dot matrix printer TVSE MSP 145. old one!
> >
> > I assume I cannot populate jtable and print it. I
> > would need to handling priting in code. For
> simple
> > reports I guess html will be better option as its
> easy
> > to generate markup compared to do drawing on
> canvas.
> >
> > Miten.
> >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Check out the new Yahoo! Front Page.
> > www.yahoo.com
> >
> >
>
===========================================================================
> > To unsubscribe, send email to
> listserv@java.sun.com and include in the body
> > of the message "signoff JAVA2D-INTEREST". For
> general help, send email to
> > listserv@java.sun.com and include in the body of
> the message "help".
>
>
===========================================================================
> To unsubscribe, send email to listserv@java.sun.com
> and include in the body
> of the message "signoff JAVA2D-INTEREST". For
> general help, send email to
> listserv@java.sun.com and include in the body of the
> message "help".
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".