*
The moose likes Swing / AWT / SWT and the fly likes how to create dynamic report? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to create dynamic report?" Watch "how to create dynamic report?" New topic
Author

how to create dynamic report?

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2
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: 1076
    
  10

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: 980
    
    2
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: 1076
    
  10

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: 980
    
    2
they helps me...
thank you..
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create dynamic report?
 
Similar Threads
reports- Urgent, please help
What is the best way for reporting in JavaSwing Application?
printing report in PDF
Jasper reports - Group several subreports
Print a report