Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create dynamic report?

 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • 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??
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 1012
2
  • Mark post as helpful
  • send pies
  • 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: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
they helps me...
thank you..
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic