• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using the print method of the Printable interface

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the print method of the Printable interface. Through this method I can write text or graphics but I have trouble including data which is of a variable format. For example I have a resultSet which has been retrieved from a database and I wish to include these details on the format of the page.
I have tried creating a new method execSql within the same PrintObject class which creates the resultSet. When trying to create a new instance of the class from within Print so that I can use the execSql method I get an error.
Does the print method allow us to call other methods which return resultsets or individual fields?
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yes, as long as you take that resultSet and format it into a "drawing" of the page to be printed.
You might try looking into using JasperReports from SourceForge - it is open source.
 
Mark Whitty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Cindy for your response.
The problem I am having is converting the resultset type into a "drawing" type. Would you be able to point me to an example of how this is done?
Thanks in advance,
Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic