Can any one help me in generating a billing report in java without using any reporting tool.
I should get the header, footer and pagebreaks.If the billing takes two pages then header should cum in first page and footer in last page..please help me I would be favourable for u help.

9 Years
Discussion Span
Last Post by masijade

Well, it looks like you have your requirements, so do you have a question? Or did you simply want us to do it for you?


Now I have a requirement.The data in the bill is dynamically displaying(using request.getparameter).And Iam unable to give the pagebreak.If the user has select certain items once he go for print,if it is of two pages,it should have header in first page and footer at the second page..plz help me. I dnt have time to go for reporting tool


Well, to tell you the truth, it will probably take longer to rig something up on your own, than it would be to plug in a "reporting tool".

The problem is, you have to format the document for the printer. which means you would have to analyze what is to be printed yourself and determine the page breaks. Any "reporting tool" API will already have done this, and you simply need to use it.

In general, it is quicker to search for, preliminary test, and plug in a third party API than it is to "reinvent" the wheel. There will be times where it is not allowed, has much more than is needed, or is simply to complex, but those are generally the exception to the rule.

And this,

I dnt have time to go for reporting tool

tells me I was right on the money with

you simply want us to do it for you


To summarise, it will be quicker (I believe) to find a "reporting tool" than it will be to do it yourself, regardless of the "help"/code you might get here. That code would still need to be analysed and then adapted so it works with your code and for your puposes, and even that alone (even if I were to include a code block) would probably take just as long (or very possibly longer) than it would to plug in a "reporting tool".


Thank u for ur suggestion.As I already said to my T.L,but He asked me to try manually.This reporting tools have cum recently.How people used to generate in the past.I knew the way he thinks is wrong.But as junior i shuld do as he said.If there is any possility,I will be favourable.


A simple one. Use Courier print face, with 69 (this number comes from the old military reporting guidelines, you can determine this number for yourself, if you wish, obviously) characters per line, design a header and a footer, then determine how many lines are left for printing and break the text up into blocks that size placing the header and footer between each block. If it is suppossed to be done manually, that is the quickest way.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.