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.

            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();

            JasperReport jr = JasperCompileManager.compileReport(jd);
            JasperPrint jp = JasperFillManager.fillReport(jr, null,con);


        catch(JRException ex){
            JOptionPane.showMessageDialog(null, ex);
        catch(Exception ex){
            JOptionPane.showMessageDialog(null, ex);

Recommended Answers

Is the date format correct? (yyyy-mm-dd)

Jump to Post

All 2 Replies

Is the date format correct? (yyyy-mm-dd)

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.