• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"));
document.open();
...
...
...
document.close();

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.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
User ID : ${PROFILE_ID}



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

Hope this helps.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic