Creating HTML files from Java accessing Oracle  
Author Message
mackdaddy315





PostPosted: 2004-6-22 4:41:00 Top

java-programmer, Creating HTML files from Java accessing Oracle Hello folks,
I have some queries that folks would like to have as HTML reports. At
first I tried Oracle Reports but it's HTML output seems really poor
and not 508 compliant which is an issue for us. I'd like to use JAVA
(I use Jdev as my IDE right now.) but was hoping someone might have
some insight on the best way to tackle this. I guess I am looking for
methods that would make things easier rather than just outputting
print commands line by line. :)

Thanks folks...
 
Roedy Green





PostPosted: 2004-6-22 4:54:00 Top

java-programmer >> Creating HTML files from Java accessing Oracle On 21 Jun 2004 13:40:55 -0700, email***@***.com (DM) wrote or
quoted :

>I guess I am looking for
>methods that would make things easier rather than just outputting
>print commands line by line. :)

First use CSS.

Then internally have objects provide their own wrappers, e.g.
String getText()
{ return text; }

String getHTML()
{ return "<span class=\"custname\">" + entify( text ) + "</span">; }

Then you can knock out the HTML like this:

out.println( thing.getHtML() + thing2.getHTML() );

And you don't have to think about making tags balance.

You can create code like this

String li ( String body )
{
return "<li>" + body + </li>;
}

This is ever so much easier than trying to keep track of balancing
yourself.


don't try to make it readable with indents and line breaks. Use a
beautifier if you have to examine the output.


See http://mindprod.com/products.html#ENTITIES
for code to insert and remove entities.

you might do something to collapse two identical class spans into one.
and to collapse multiple spaces into one.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Christophe Vanfleteren





PostPosted: 2004-6-22 5:09:00 Top

java-programmer >> Creating HTML files from Java accessing Oracle Roedy Green wrote:

> On 21 Jun 2004 13:40:55 -0700, email***@***.com (DM) wrote or
> quoted :
>
>>I guess I am looking for
>>methods that would make things easier rather than just outputting
>>print commands line by line. :)
>
> First use CSS.
>
> Then internally have objects provide their own wrappers, e.g.
> String getText()
> { return text; }
>
> String getHTML()
> { return "<span class=\"custname\">" + entify( text ) + "</span">; }
>
> Then you can knock out the HTML like this:
>
> out.println( thing.getHtML() + thing2.getHTML() );
>
> And you don't have to think about making tags balance.
>
> You can create code like this
>
> String li ( String body )
> {
> return "<li>" + body + </li>;
> }
>
> This is ever so much easier than trying to keep track of balancing
> yourself.
>

...

Or you could just use a templating engine like velocity.

http://jakarta.apache.org/velocity/
http://mindprod.com/jgloss/velocity.html

--
Kind regards,
Christophe Vanfleteren
 
 
Michael Rauscher





PostPosted: 2004-6-22 6:16:00 Top

java-programmer >> Creating HTML files from Java accessing Oracle DM schrieb:

> Hello folks,
> I have some queries that folks would like to have as HTML reports. At
> first I tried Oracle Reports but it's HTML output seems really poor
> and not 508 compliant which is an issue for us. I'd like to use JAVA
> (I use Jdev as my IDE right now.) but was hoping someone might have
> some insight on the best way to tackle this. I guess I am looking for
> methods that would make things easier rather than just outputting
> print commands line by line. :)
>
> Thanks folks...

Perhaps it's worth to use XSLT. This way the application is separated
from the layout of the resulting HTML page.

Just an idea
Bye
Michael

 
 
FlameDance





PostPosted: 2004-6-24 5:46:00 Top

java-programmer >> Creating HTML files from Java accessing Oracle I bought O'Reilley's Java Servlet Cookbook, installed Tomcat Apache
instead of the Oracle web server, and was happy within a few days.

DM schrieb:
> Hello folks,
> I have some queries that folks would like to have as HTML reports. At
> first I tried Oracle Reports but it's HTML output seems really poor
> and not 508 compliant which is an issue for us. I'd like to use JAVA
> (I use Jdev as my IDE right now.) but was hoping someone might have
> some insight on the best way to tackle this. I guess I am looking for
> methods that would make things easier rather than just outputting
> print commands line by line. :)
>
> Thanks folks...
 
 
mackdaddy315





PostPosted: 2004-7-10 0:27:00 Top

java-programmer >> Creating HTML files from Java accessing Oracle email***@***.com (DM) wrote in message news:<email***@***.com>...
> Hello folks,
> I have some queries that folks would like to have as HTML reports. At
> first I tried Oracle Reports but it's HTML output seems really poor
> and not 508 compliant which is an issue for us. I'd like to use JAVA
> (I use Jdev as my IDE right now.) but was hoping someone might have
> some insight on the best way to tackle this. I guess I am looking for
> methods that would make things easier rather than just outputting
> print commands line by line. :)
>
> Thanks folks...


FYI all,
I setup JFreeReports and JFreeCharts ( http://jfree.org ) and have
been really happy with the results thus far. Figured I would let
folks know as an fyi...