Hi

I am trying to genarate report in java.

my basic requirement is like:

1. i have to print sales invoice in .txt format.
2. In application, user will select sales invoice no in drop down list.
after clicking print button, user can show his invoice .
3. invoice contain only three column ( simple invoice format)

1. item name 2. rate. 3.qty 4. amount

finally in detail, it will print Total amount.

---------------------------------------------
item name Rate Qty Amount
---------------------------------------------

ABC 10 10 100
PQR 05 10 50

--------------------------------------------
Total: 150
--------------------------------------------


Whether it is possible to print above format report without using
any report tool like Eclipse Birt,Jasper Report, IReport


Kindly suggest any solution.

Thanks

Recommended Answers

Easy.
Just open a PrintStream to the .txt file and use print(...) to print the details and the lines one at a time.
http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintStream.html

Jump to Post

All 4 Replies

Hi
Can you give me some more explanation above lines.

Thanks

>Whether it is possible to print above format report without using
any report tool like Eclipse Birt,Jasper Report, IReport

Take a look at - http://trac.inamik.com/trac/jtable_format (TableFormatter)

Hi
Can you give me some more explanation above lines.
Thanks

Just a series of print statements, with a little loop to print the items - like this (pseudo code, not Java syntax)

print "--------------------------------------"
print "item name ..."
...
for each item in invoice
   print item.name, item.rate ...
print "--------------------------------------"
print "Total: " + invoice.total
...
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.