error in something :net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : size
What I have tried:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 4.5.0 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report name" pageWidth="595" pageHeight="842" whenNoDataType="NoPages" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.7715610000000028"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="221"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<parameter name="Parameter32" class="java.lang.String"/>
<parameter name="Parameter31" class="java.lang.String"/>
<parameter name="Parameter29" class="java.lang.String"/>
<parameter name="Parameter30" class="java.lang.String"/>
<parameter name="Parameter28" class="java.lang.String"/>
<parameter name="Parameter26" class="java.lang.String"/>
<parameter name="Parameter27" class="java.lang.String"/>
<parameter name="Parameter25" class="java.lang.String"/>
<parameter name="Parameter21" class="java.lang.String"/>
<parameter name="Parameter22" class="java.lang.String"/>
<parameter name="Parameter23" class="java.lang.String"/>
<parameter name="Parameter24" class="java.lang.String"/>
<parameter name="Parameter20" class="java.lang.String"/>
<parameter name="Parameter18" class="java.lang.String"/>
<parameter name="Parameter19" class="java.lang.String"/>
<parameter name="Parameter12" class="java.lang.String"/>
<parameter name="Parameter13" class="java.lang.String"/>
<parameter name="Parameter14" class="java.lang.String"/>
<parameter name="Parameter15" class="java.lang.String"/>
<parameter name="Parameter16" class="java.lang.String"/>
<parameter name="Parameter17" class="java.lang.String"/>
<parameter name="Parameter7" class="java.lang.String"/>
<parameter name="Parameter8" class="java.lang.String"/>
<parameter name="Parameter9" class="java.lang.String"/>
<parameter name="Parameter10" class="java.lang.String"/>
<parameter name="Parameter11" class="java.lang.String"/>
<parameter name="Parameter6" class="java.lang.String"/>
<parameter name="Parameter5" class="java.lang.String"/>
<parameter name="Parameter4" class="java.lang.String"/>
<parameter name="Parameter3" class="java.lang.String"/>
<parameter name="Parameter2" class="java.lang.String"/>
<parameter name="Parameter1" class="java.lang.String"/>
<parameter name="Parameter34" class="java.lang.String"/>
<parameter name="Parameter33" class="java.lang.String"/>
<field name="size" class="java.lang.String"/>
<field name="ply" class="java.lang.String"/>
<field name="bndl" class="java.lang.String"/>
<field name="rate" class="java.lang.String"/>
<field name="amount" class="java.lang.String"/>
<field name="hsn" class="java.lang.String"/>
<field name="desc" class="java.lang.String"/>
<field name="pcs" class="java.lang.String"/>
<field name="qty" class="java.lang.String"/>
<field name="los_pcs" class="java.lang.String"/>
<title>
<band height="283" splitType="Stretch"/>
</title>
<pageHeader>
<band height="17" splitType="Stretch">
<rectangle>
<reportElement x="0" y="0" width="285" height="16"/>
</rectangle>
<rectangle>
<reportElement x="285" y="0" width="270" height="16"/>
</rectangle>
<staticText>
<reportElement x="0" y="0" width="83" height="17"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[INVOICE No. :]]></text>
</staticText>
<staticText>
<reportElement x="441" y="0" width="39" height="16"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[DATE:]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="142" splitType="Stretch">
<rectangle>
<reportElement x="0" y="0" width="285" height="142"/>
</rectangle>
<rectangle>
<reportElement x="285" y="0" width="270" height="142"/>
</rectangle>
<staticText>
<reportElement x="2" y="80" width="54" height="20"/>
<text><![CDATA[State:]]></text>
</staticText>
<staticText>
<reportElement x="157" y="80" width="40" height="20"/>
<text><![CDATA[Code:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="0" width="130" height="22"/>
<text><![CDATA[Buyer's Name & Address]]></text>
</staticText>
<staticText>
<reportElement x="1" y="100" width="53" height="20"/>
<text><![CDATA[GSTIN No. :]]></text>
</staticText>
<staticText>
<reportElement x="160" y="100" width="40" height="20"/>
<text><![CDATA[PAN:]]></text>
</staticText>
<staticText>
<reportElement x="289" y="80" width="41" height="20"/>
<text><![CDATA[State:]]></text>
</staticText>
<staticText>
<reportElement x="289" y="100" width="54" height="20"/>
<text><![CDATA[GSTIN No. :]]></text>
</staticText>
<staticText>
<reportElement x="427" y="80" width="38" height="20"/>
<text><![CDATA[Code:]]></text>
</staticText>
<staticText>
<reportElement x="286" y="2" width="66" height="20"/>
<text><![CDATA[Delivery at:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="120" width="49" height="20"/>
<text><![CDATA[Phone:]]></text>
</staticText>
<textField>
<reportElement x="200" y="77" width="85" height="23"/>
<textFieldExpression><![CDATA[$P{Parameter5}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="52" y="120" width="76" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter4}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="54" y="100" width="76" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter3}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="52" y="82" width="76" height="17"/>
<textFieldExpression><![CDATA[$P{Parameter2}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="-1" y="22" width="161" height="18"/>
<textFieldExpression><![CDATA[$P{Parameter1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="100" width="85" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter6}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="340" y="80" width="82" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter7}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="340" y="100" width="81" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter8}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="286" y="22" width="144" height="18"/>
<textFieldExpression><![CDATA[$P{Parameter9}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="463" y="80" width="90" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter10}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1" y="40" width="142" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter29}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="-1" y="60" width="142" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter30}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="285" y="60" width="144" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter32}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="286" y="40" width="135" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter31}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="162" splitType="Stretch">
<rectangle>
<reportElement x="0" y="0" width="83" height="142"/>
</rectangle>
<rectangle>
<reportElement x="83" y="0" width="117" height="142"/>
</rectangle>
<rectangle>
<reportElement x="340" y="0" width="39" height="142"/>
</rectangle>
<rectangle>
<reportElement x="297" y="0" width="43" height="142"/>
</rectangle>
<rectangle>
<reportElement x="441" y="0" width="38" height="142"/>
</rectangle>
<rectangle>
<reportElement x="479" y="0" width="76" height="162"/>
</rectangle>
<rectangle>
<reportElement x="200" y="0" width="60" height="142"/>
</rectangle>
<rectangle>
<reportElement x="260" y="0" width="37" height="142"/>
</rectangle>
<rectangle>
<reportElement x="0" y="0" width="83" height="18"/>
</rectangle>
<rectangle>
<reportElement x="83" y="0" width="117" height="18"/>
</rectangle>
<rectangle>
<reportElement x="200" y="0" width="60" height="18"/>
</rectangle>
<rectangle>
<reportElement x="260" y="0" width="37" height="18"/>
</rectangle>
<rectangle>
<reportElement x="297" y="0" width="43" height="18"/>
</rectangle>
<rectangle>
<reportElement x="479" y="0" width="76" height="18"/>
</rectangle>
<rectangle>
<reportElement x="340" y="0" width="39" height="18"/>
</rectangle>
<rectangle>
<reportElement x="441" y="0" width="38" height="18"/>
</rectangle>
<staticText>
<reportElement x="5" y="4" width="78" height="18"/>
<text><![CDATA[DESCRIPTION]]></text>
</staticText>
<staticText>
<reportElement x="114" y="4" width="32" height="14"/>
<text><![CDATA[SIZE]]></text>
</staticText>
<staticText>
<reportElement x="219" y="4" width="41" height="14"/>
<text><![CDATA[HSN]]></text>
</staticText>
<staticText>
<reportElement x="272" y="4" width="25" height="14"/>
<text><![CDATA[PLY]]></text>
</staticText>
<staticText>
<reportElement x="492" y="0" width="57" height="20"/>
<text><![CDATA[AMOUNT]]></text>
</staticText>
<staticText>
<reportElement x="311" y="4" width="27" height="14"/>
<text><![CDATA[BDLS]]></text>
</staticText>
<staticText>
<reportElement x="347" y="4" width="32" height="20"/>
<text><![CDATA[PCS]]></text>
</staticText>
<staticText>
<reportElement x="449" y="2" width="31" height="16"/>
<text><![CDATA[RATE]]></text>
</staticText>
<rectangle>
<reportElement x="379" y="0" width="62" height="18"/>
</rectangle>
<rectangle>
<reportElement x="379" y="18" width="62" height="124"/>
</rectangle>
<staticText>
<reportElement x="397" y="4" width="32" height="14"/>
<text><![CDATA[QTY]]></text>
</staticText>
<rectangle>
<reportElement x="379" y="142" width="62" height="20"/>
</rectangle>
<rectangle>
<reportElement x="341" y="142" width="38" height="20"/>
</rectangle>
<rectangle>
<reportElement x="297" y="142" width="44" height="20"/>
</rectangle>
<rectangle>
<reportElement x="0" y="142" width="297" height="20"/>
</rectangle>
<textField>
<reportElement x="83" y="22" width="117" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b0fa8ace-0e5c-4417-9432-eec851d71dee"/>
</reportElement>
<textFieldExpression><![CDATA[$F{size}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="260" y="22" width="37" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="82956727-1b3f-44f5-8a4b-8569d08de109"/>
</reportElement>
<textFieldExpression><![CDATA[$F{ply}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="298" y="24" width="40" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a275e482-6d94-4c31-a84c-1b6d87fda603"/>
</reportElement>
<textFieldExpression><![CDATA[$F{bndl}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="441" y="22" width="39" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="85c9ffd0-0574-421f-8ee8-ba2ab900e756"/>
</reportElement>
<textFieldExpression><![CDATA[$F{rate}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="480" y="22" width="75" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0b07b46b-c295-4481-8890-ed7f2269ce08"/>
</reportElement>
<textFieldExpression><![CDATA[$F{amount}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="22" width="60" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="8acbd901-d703-4f13-a548-5a9488e6f4dc"/>
</reportElement>
<textFieldExpression><![CDATA[$F{hsn}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="22" width="83" height="18">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="967c40a0-0f96-429e-aabd-569572142fee"/>
</reportElement>
<textFieldExpression><![CDATA[$F{desc}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="379" y="142" width="62" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter26}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="298" y="141" width="43" height="19"/>
<textFieldExpression><![CDATA[$P{Parameter27}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="1" y="141" width="127" height="19"/>
<text><![CDATA[Eeletronic Reference No. :]]></text>
</staticText>
<textField>
<reportElement x="130" y="142" width="167" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter28}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="341" y="24" width="37" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0e748255-2f68-488a-9126-5c6ace94d6c9"/>
</reportElement>
<textFieldExpression><![CDATA[$F{los_pcs}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="379" y="24" width="42" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="25da6712-05fa-49ef-8efd-c8ec01e9f915"/>
</reportElement>
<textFieldExpression><![CDATA[$F{pcs}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="412" y="24" width="29" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="45fbb595-de52-403a-9c81-f580e86bc93f"/>
</reportElement>
<textFieldExpression><![CDATA[$F{qty}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="192" splitType="Stretch">
<rectangle>
<reportElement x="1" y="117" width="554" height="73"/>
</rectangle>
<rectangle>
<reportElement x="0" y="0" width="428" height="81"/>
</rectangle>
<rectangle>
<reportElement x="428" y="0" width="127" height="81"/>
</rectangle>
<rectangle>
<reportElement x="428" y="81" width="127" height="20"/>
</rectangle>
<rectangle>
<reportElement x="0" y="81" width="428" height="20"/>
</rectangle>
<staticText>
<reportElement x="430" y="85" width="62" height="16"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[GRAND TOTAL]]></text>
</staticText>
<staticText>
<reportElement x="430" y="2" width="33" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[TOTAL]]></text>
</staticText>
<staticText>
<reportElement x="430" y="22" width="34" height="19"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[SGST]]></text>
</staticText>
<staticText>
<reportElement x="430" y="41" width="33" height="16"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[CGST]]></text>
</staticText>
<staticText>
<reportElement x="1" y="81" width="67" height="20"/>
<text><![CDATA[Invoice Value :]]></text>
</staticText>
<staticText>
<reportElement x="430" y="61" width="28" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[IGST]]></text>
</staticText>
<rectangle>
<reportElement x="0" y="101" width="555" height="16"/>
</rectangle>
<staticText>
<reportElement x="14" y="101" width="535" height="16"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[For RTGS/NEFT: HDFC BANK, MALERKOTLA A/C No. :06498620000084 CODE: HDFC0000649]]></text>
</staticText>
<staticText>
<reportElement x="0" y="117" width="29" height="9"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[TERMS:]]></text>
</staticText>
<staticText>
<reportElement x="30" y="117" width="170" height="9"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[1. Our responsibility ceases after the goods leave the godown.]]></text>
</staticText>
<staticText>
<reportElement x="30" y="136" width="295" height="10"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[3. The customers are reponsible for all the expenses incurred by the way of refused or dishonouring the bills.]]></text>
</staticText>
<staticText>
<reportElement x="30" y="126" width="255" height="10"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[2. All bills standing unpaid after 7 days from presentation interest @18% p.a. will be charged ]]></text>
</staticText>
<staticText>
<reportElement x="449" y="165" width="76" height="12"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Authorised Signatory]]></text>
</staticText>
<staticText>
<reportElement x="27" y="158" width="284" height="19"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[Certified that the particulars given above are true & correct and amount indicated represents the price actually charged and that there is no flow of additional considration directly or indirectly from the buyer.]]></text>
</staticText>
<staticText>
<reportElement x="29" y="146" width="288" height="12"/>
<textElement>
<font size="6"/>
</textElement>
<text><![CDATA[4. Dispute if any shall be subject to Malerkotla Jusdiction only.]]></text>
</staticText>
<staticText>
<reportElement x="416" y="117" width="139" height="19"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[For Jai Durga Kraft Paper Pvt. Ltd.,]]></text>
</staticText>
<staticText>
<reportElement x="8" y="22" width="42" height="13"/>
<text><![CDATA[GR No. :]]></text>
</staticText>
<staticText>
<reportElement x="5" y="68" width="78" height="13"/>
<text><![CDATA[Documantation :]]></text>
</staticText>
<staticText>
<reportElement x="220" y="6" width="40" height="16"/>
<text><![CDATA[Date :]]></text>
</staticText>
<staticText>
<reportElement x="220" y="22" width="42" height="18"/>
<text><![CDATA[Date :]]></text>
</staticText>
<staticText>
<reportElement x="4" y="53" width="74" height="13"/>
<text><![CDATA[Transport :]]></text>
</staticText>
<staticText>
<reportElement x="8" y="6" width="73" height="16"/>
<text><![CDATA[Order No.]]></text>
</staticText>
<staticText>
<reportElement x="4" y="35" width="60" height="18"/>
<text><![CDATA[Vehicle No. :]]></text>
</staticText>
<staticText>
<reportElement x="220" y="40" width="40" height="17"/>
<text><![CDATA[Fraight :]]></text>
</staticText>
<textField>
<reportElement x="86" y="4" width="86" height="16"/>
<textFieldExpression><![CDATA[$P{Parameter12}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="87" y="40" width="84" height="17"/>
<textFieldExpression><![CDATA[$P{Parameter13}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="87" y="53" width="84" height="15"/>
<textFieldExpression><![CDATA[$P{Parameter14}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="88" y="68" width="82" height="13"/>
<textFieldExpression><![CDATA[$P{Parameter15}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="260" y="22" width="84" height="18"/>
<textFieldExpression><![CDATA[$P{Parameter16}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="263" y="41" width="84" height="16"/>
<textFieldExpression><![CDATA[$P{Parameter17}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="259" y="6" width="85" height="16"/>
<textFieldExpression><![CDATA[$P{Parameter19}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="86" y="22" width="100" height="13"/>
<textFieldExpression><![CDATA[$P{Parameter19}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="83" y="82" width="333" height="19"/>
<textFieldExpression><![CDATA[$P{Parameter20}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="468" y="0" width="87" height="20"/>
<textFieldExpression><![CDATA[$P{Parameter21}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="20" width="63" height="15"/>
<textFieldExpression><![CDATA[$P{Parameter22}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="490" y="38" width="65" height="19"/>
<textFieldExpression><![CDATA[$P{Parameter23}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="461" y="60" width="94" height="21"/>
<textFieldExpression><![CDATA[$P{Parameter24}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="80" width="63" height="19"/>
<textFieldExpression><![CDATA[$P{Parameter25}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="464" y="23" width="28" height="16"/>
<textFieldExpression><![CDATA[$P{Parameter33}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="461" y="40" width="34" height="17"/>
<textFieldExpression><![CDATA[$P{Parameter34}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
package stock_sample;
import java.sql.*;
import java.lang.Math;
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.view.JasperViewer;
public class Field {
private static String address1 = "C:\\Users\\HP\\JaspersoftWorkspace\\MyReports\\invoiceff.jrxml";
private String gst;
String address = "C:\\Users\\HP\\Documents\\stocks_project_db\\";
public String billno;
private String invoice_n,invoice_val,or_no,date_1,date_2,gr_no,vehicle,transport,fraight,total,sgst,igst,g_total;
private String buyer_n1,buyer_n2,buyer_n3,state,gstin,code,pan,phone;
private String t_bndl = "0";
private String t_qty = "0";
private static Connection con2 = null;
public void getBill(String bb){
billno = bb;
}
public Connection con(String add){
Connection con = null;
try{
String connn = "jdbc:ucanaccess://" + address + add + ".accdb";
con = DriverManager.getConnection(connn);
}catch(Exception e){
System.out.println("Error in connection :" + e);
}
return con;
}
public ResultSet results(String sql){
ResultSet resul = null;
try{
Statement st = con2.createStatement();
resul = st.executeQuery(sql);
}catch(Exception e){
System.out.println("Error in ResultSet :" + e);
}
return resul;
}
public Collection fdata() throws SQLException{
String desc,size,hsn,ply,bndl,los_pcs,pcs,qty,rate,amount;
String rate1 = "";
ArrayList<fields> arr = new ArrayList<fields>();
String sql1 = "SELECT * FROM product_inbill where bill_number = " + billno + ";";
ResultSet rss = results(sql1);
while(rss.next()){
size = rss.getString("product_name");
bndl = rss.getString("bundles");
los_pcs = rss.getString("loose_pcs");
rate1 = rss.getString("rateperpeice");
DecimalFormat df = new DecimalFormat("0.00");
rate =df.format(Double.parseDouble(rate1));
pcs = rss.getString("net_qty");
qty = rss.getString("qty");
amount = String.valueOf(Math.round((Double.parseDouble(pcs))*(Double.parseDouble(rate))));
t_bndl = String.valueOf((Integer.parseInt(t_bndl)+Integer.parseInt(bndl)));
t_qty = String.valueOf((Integer.parseInt(t_qty)+Integer.parseInt(pcs)));
String sql2 = "SELECT * FROM product_descriptions where product_type = '" + size + "';";
ResultSet rss1 = results(sql2);
while(rss1.next()){
desc = rss1.getString("product_name");
hsn = rss1.getString("code");
ply = rss1.getString("ply");
fields f = new fields(desc,size,hsn,ply,bndl,los_pcs,pcs,qty,rate,amount);
arr.add(f);
}
}
return arr;
}
public void something(){
try {
JasperReport jp = JasperCompileManager.compileReport(address1);
HashMap para = new HashMap();
para.put("Parameter1","nabha paper mill");
JRBeanCollectionDataSource jcd = new JRBeanCollectionDataSource(fdata());
JasperPrint print = JasperFillManager.fillReport(jp, para,jcd);
JasperViewer.viewReport(print,false);
} catch (Exception ex) {
System.out.print("error in something :" + ex);
}
}
public static void main(String [] args){
Field fgh = new Field();
fgh.getBill("33");
try{
con2 = fgh.con("BILLS");
}catch(Exception e){
System.out.print("Error in 124 : + e");
}
try {
fgh.fdata();
} catch (SQLException ex) {
System.out.print("Error in 131 :" + ex);
}
try{
fgh.something();
}catch(Exception ee){
System.out.print("Error in 134" + ee);
}
}
private static class fields {
public String getDesc() {
return desc;
}
public String getSize() {
return size;
}
public String getHsn() {
return hsn;
}
public String getPly() {
return ply;
}
public String getBndls() {
return bndl;
}
public String getLos_pcs() {
return los_pcs;
}
public String getPcs() {
return pcs;
}
public String getQty() {
return qty;
}
public String getRate() {
return rate;
}
public String getAmount() {
return amount;
}
private String desc,size,hsn,ply,bndl,los_pcs,pcs,qty,rate,amount;
public fields(String desc,String size,String hsn,String ply,String bndl,String los_pcs,String pcs,String qty,String rate,String amount) {
this.desc = desc;
this.ply = ply;
this.bndl = bndl;
this.size = size;
this.los_pcs = los_pcs;
this.pcs = pcs;
this.rate = rate;
this.hsn = hsn;
this.qty = qty;
this.amount = amount;
}
}
}