Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes report generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "report generation" Watch "report generation" New topic
Author

report generation

anjali pandit
Greenhorn

Joined: Apr 20, 2005
Posts: 2
Hi

I have posted this doubt before but somehow it was deleted, don't know why.

The ques is, how to display data retrived from oracle database and from within a java application as a report.
Is it possible to convert the result set recieved into XML data and then display it.

Thanks
Anjali
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Welcome to Javaranch Anjali,
It is possible, but why you want to use xml in the middle ? why not directly from database to report ?
What are the output display formats you were trying to do ?
Thank you
Regards
Balaji
anjali pandit
Greenhorn

Joined: Apr 20, 2005
Posts: 2
Hi Balaji

Thanks for reply.

If not XML , what are the other ways with which i can generate report from within a servlets where i recieve the result set.

It would be great if you can guide me about how to convert the result set to XML data and also the other way which you think is better.

Thanks
Anjali
Rashmi Razdan
Ranch Hand

Joined: Feb 06, 2005
Posts: 70
Anjali,

Whats the database at the backend, soln depends on that as well; If oracle which version?

I think its possible to generate directly excel file in java from result set, so u can skip xml stage in that case.


Hi Balaji/anjali,

I have reqt of getting the o/p in intermediate stage as XML (which will be archived) and then convert the same as PDF file for clients.
Why I want xml as intermeditate is becos :

1.The resulting data of xml is based on a lot of calculations, so i want intermediate stage for any manual corrections required.Also i want archiving of these xml files .
2. The resulting o/p from xml (using XSLT ), can vary in differnt formats , pie chart, excel , pdf etc.. as the need arises.
3.The read-only o/p (e.g pdf) represented can be sub-part of the xml or combination of 2 to 3 xml files generated as one report.

Now i want to know ,
-Q1 how is the xml generation performance(time taken) from Oracle (8i/9i/10g), the report can be 10- 60 pages long and of complex nature.
-Q2 why im specifying all 3 versions is becos if I have to build the diff o/p combinations, and xml is the only soln, then i can ask client to go for specific version (for a given performance reqt).

-Q3 How feasible is the PDF generation from this xml in terms of
- tools required
- time taken
- coding effort

-Will direct PDF generation from the database be beter soln in any other way.

Peformance is of utmost importance as we need to generate 5000 reports in 3hrs.

Thanks,
Rashmi
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 860
If you want to display data in an html table, or xml, or any textual format for that matter check out my FormattedDataSet API in the link below. The live demo allows you to execute a query and have it formatted as an html table. Another part of the demo allows you to format an array in various ways (html table, csv, xml). The formattedDataSet works against a tabular data interface, so most forms of tabular data can be supported.


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by anjali pandit:
Hi Balaji
Thanks for reply.
If not XML , what are the other ways with which i can generate report from within a servlets where i recieve the result set.
It would be great if you can guide me about how to convert the result set to XML data and also the other way which you think is better.
Thanks
Anjali


You havent mentioned in what format you wanna prepare the report. If it is only PDF then you can try iText (because using Apache FOP involves the process of converting db to xml to xsl:fo, but still its worth).

On the other hand, if you have the data ready as XML, then you have wide choice of reporting like excel, pdf, word, chart, svg etc.,
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Rashmi Razdan:

Hi Balaji/anjali,
-Q1 how is the xml generation performance(time taken) from Oracle (8i/9i/10g), the report can be 10- 60 pages long and of complex nature.
-Q2 why im specifying all 3 versions is becos if I have to build the diff o/p combinations, and xml is the only soln, then i can ask client to go for specific version (for a given performance reqt).


Measurement performance is not very straight forward, as you have to where exactly the resource is get sucked, it can happen at SQL query level, inside the database itself, on constructing the xml DOM or String, call connections, and then the generation of PDF.
IMHO, 1. the link posted by Steve JAMon, looks interesting.
2.You can also post this question in Performance forum.

-Q3 How feasible is the PDF generation from this xml in terms of
- tools required

Apache FOP sounds perfect.

- time taken
depends on the xslt and xpath.

- coding effort

Involves creating xsl:fo tags but its simple if you know how to use xslt for html generation

-Will direct PDF generation from the database be beter soln in any other way.
If you are not going to generate other outputs like excel,pie,svg,word etc, then direct generation would be more appropriate, IMHO(this is my opinion)

Peformance is of utmost importance as we need to generate 5000 reports in 3hrs.
I would suggest you to chart between iText and Apache FOP and decide a result from it
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 860


the link posted by Steve JAMon, looks interesting.



Also check out http://www.javaperformancetuning.com for much more on performance.

[Balaji]: Edited the code tags to fit the screen size.
[ May 25, 2005: Message edited by: Balaji Loganathan ]
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 860
[Balaji]: Edited the code tags to fit the screen size

I've noticed my posts don't wrap. How do I fix this?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by steve souza:

I've noticed my posts don't wrap. How do I fix this?

Its because of the long text placed under the [ code ] tags. [ code ]tag here is equivalent to < pre > tag of html, so it will not wrap on its own.
I actually edited the below comment line to fit for the screen.(it was a single line text before).
/* Because jamon uses a string you can monitor things that are not known* statically.* For example you could track the page hits by username, or by date. */
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: report generation
 
Similar Threads
asynchronuous call
display tag
JSP + Crystal Report Developer 10
exec() command
Populate Excel Spreadsheet