Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Print custom invoice of page size (20.5 x 14 cm) using jasper report or iText for Java

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to print data on invoice receipt size of 20.5 x 14 cm(hard copy). In which I try to put text at some absolute location. I tried iText first. In that I try to set page size by following code.

// here what is unite used in bracket of rectangle?

Document document = new Document(new Rectangle(552,377));

PdfWriter.getInstance(document, new FileOutputStream("report.pdf"));;

Second I tried Jasper report. In that I set page size to 20.5 x 14 cm. But how can I take value from my java application's textfield and put it in to some absolute location in iReport.

As I know jasper report take value from database but how can I take value from java application's textfiled?

I am more familiar with iText.

I will be thankful to any developer who can guide me how can I print custom invoice using iText or Jasper Report.I am developing java application using netbeans.
Posts: 3648
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

About passing in parms from java program to Jasper Report is fairly easy.

Say in your Jasper Report (jrxml) has a parm called "PROFILE_ID" and a line looking like this:

Then when you run the program passing in say "vijay", the output report will be:
User ID : vijay

Hope this helps.
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!