0

Is there any syntax error in this code or query because i am not getting the required report? I have created a JFrame with JDatechoosr. When i select the dates and click view report, it gives me empty report while i know there is data within the specified date range. Kindly help me.

try{
            JasperDesign jd = JRXmlLoader.load("Purchase.jrxml");
            String sql = "select * from purchase where purchase_date between "
                    + "'"+DateChooser_frm.getDate().toString()+"' and '"+DateChooser_to.getDate().toString()+"'";
            JRDesignQuery query = new JRDesignQuery();

            query.setText(sql);
            jd.setQuery(query);
            JasperReport jr = JasperCompileManager.compileReport(jd);
            JasperPrint jp = JasperFillManager.fillReport(jr, null,con);
            JasperViewer.viewReport(jp,false);

        }

        catch(JRException ex){
            JOptionPane.showMessageDialog(null, ex);
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(null, ex);
        }
2
Contributors
2
Replies
19
Views
3 Years
Discussion Span
Last Post by sireiz
0

yeah, i used SimpleDateFormatfor that, and i am using dates in other sections of the app but here in this report, i am having the issue, but i am not getting any exception or error.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.