I'm trying to print the necessary values in the predefined document for an example, in a Bill name in the left side and date on top right. I already had that documents with empty name and dates . how can i print the name and date to corresponding location in bill from my program. Please suggest.

Recommended Answers

All 8 Replies

What format / file type is the predefined document?

use a template file with place holders for what you want to replace and load the file into memory and do your replacements or you cound use the velocity framework for Java :)

a template file with place holders for what you want to replace and load the file into memory and do your replacements or you cound use the velocity framework for Java :)

its simply a text document with empty fields.

Mark the field positions in the document with codes, eg $1, $2 etc.
Read the whole file into a StringBuffer (including \n chars).
Replace the $ codes with the appropriate data values

OR

Read the file into an array of Strings, one per line.
Create variables for the row & column numbers for each data field
Overwrite the appropriate colsumns in the appropriate rows (array elements) for each data field.

OR

.. any number of similar kinds of approach

I don't know from where to start. Actual i want to print this type of bill as given below. i need the data to be printed in the correct position as it should be.Please tell give me some examples.
untitled30

You said earlier "it's simply a text document..." - so how do you draw those boxes?

i mean to say a paper. sorry for my bad english is it possible to do that. How please suggest

hello can anybody provide me example relating to bill print in java.

Be a part of the DaniWeb community

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