| Author |
how to create dynamic report?
|
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 902
|
|
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
Joined: Oct 16, 2003
Posts: 915
|
|
|
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.
|
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
|
 |
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 902
|
|
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
Joined: Oct 16, 2003
Posts: 915
|
|
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
Joined: Aug 20, 2011
Posts: 902
|
|
they helps me...
thank you..
|
 |
Ranganathan Kaliyur Mannar
Bartender
Joined: Oct 16, 2003
Posts: 915
|
|
|
You're welcome.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: how to create dynamic report?
|
|
|