I'm designing a java application to a pharmacy and I wanted to print a bill for their customers. I tried using jasper
reports but I was unable to design it properly.
I have created 2 jTables
to display items in stock and another to display the bill. Bellow the bill table 2 jLables
and 1 jTextField
used to show the total, balance and received amounts. I wanted to print the details in the bill table and values in 2 jLabels
and jTextField
when I click the "Pay" button. I want to design it like this POS bill
How to design and print a bill like this in java? How to change the page size?
I'm using netbeans
to develop.
Can any one please help me?
Use the Jasper Report Studio or Netbeans plugin to create your bill. Before start to work with Jasper it is better to go through a jasper related document or online tutorial.
http://www.tutorialspoint.com/jasper_reports/jasper_report_fields.htm https://community.jaspersoft.com/wiki/jasperreports-library-tutorial https://community.jaspersoft.com/wiki/designing-report-jaspersoft-studio
You don not need to create a separate table to keep stock and bill separately.I think it is better to keep all records in one jTable.Then you can get that jTabel as a data source into the Jasper Report .You can pass total, balance and amount values as parameters into the jasper report and place those values in the correct place of the bill
If you use the Jasper Report studio or netbeans plugin, right click on the report icon in the "Outline" window to get the page setup menu
Good Luck !!!!!