• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

how to create dynamic report?

 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a registration page.
now i want to generate a dynamic report of student.
how can i do that??
what i m thinking is:
just fetching the values from the database, and displaying them in textfield or labels, and add the logo, and then print that.
is that only i can do??
or any other thing??
and if this only then how will i print them??
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also think of using a reporting engine like JasperReports. It comes with a report designer named iReport. You can design the report and use it by passing POJOs - Jasper provides easy integration with Swing via JPanel and then you should be able to print that JPanel or JDialog on which the report is displayed.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay...
if i go with 1st one, i mean without using jasper report..
can you tell me how can i do that?
i mean my page(hardcopy) is (which has header and footer) fixed.
i need to print the report in between header an footer..
how do i do that??

Thank you for response..
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to use the Printing API. You can check out the tutorial here.
Swing components have printing support. If it is just a JPanel, I think it would be easier. You have to place the components (say labels) using layouts or 'paint' directly using Graphics object. You have to implement the Printable interface which has a method to return the number of pages left. However, if you need a header/footer + variable information in the middle (that spawns pages), it will be slightly harder.

You can refer these JavaRanch posts (comes up straight in a Google search):
one, two
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
they helps me...
thank you..
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
reply
    Bookmark Topic Watch Topic
  • New Topic