Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2007, 03:01 AM
Senior Member
 
Join Date: Jun 2007
Posts: 164
Heather is on a distinguished road
Error With Sql And Jasper Report
I use ireport 1.3.3 and jasper report 1.3.3 to create a pdf file.
If I use ireport it works, but if I execute my web application it returns to me this error:

Error executing SQL statement for : presup

My jrxml is:
Code:
... <parameter name="SQLquery" isForPrompting="false" class="java.lang.String"> <defaultValueExpression ><![CDATA["select kc.de_buys, kc.nm_client, kc.tx_ship_notes, kc.tx_comments, kol.nm_product , kol.nu_quantity from k_buys kc inner join k_buys_lines kcl on kc.gu_buys= kcl.gu_buys inner join k_order_lines kol on kol.gu_order = kcl.gu_order"]]></defaultValueExpression> </parameter> <queryString>$P!{SQLquery}</queryString> <field name="de_buys" class="java.lang.String"/> <field name="nm_client" class="java.lang.String"/> <field name="tx_ship_notes" class="java.lang.String"/> <field name="tx_comments" class="java.lang.String"/> <field name="nm_product" class="java.lang.String"/> <field name="nu_quantity" class="java.lang.Double"/> ...



My jsp is:
Code:
String connectString = "jdbcostgresql://172.27.4.15:5432/cult/common"; String userBD = "XXXXXXXX"; String passwordBD = ""XXXXXXXX"; String driver = "org.postgresql.Driver"; Class.forName(driver); Class.forName(driver).newInstance(); Connection conn = DriverManager.getConnection(connectString, userBD, passwordBD); String sql = "select kc.de_buys, kc.nm_client, kc.tx_ship_notes, kc.tx_comments, kol.nm_product , kol.nu_quantity from k_buys inner join k_buys_lines kcl on kc.gu_buys= kcl.gu_buys inner join k_order_lines kol on kol.gu_order = kcl.gu_order where kc.gu_buys= '" + code + "'"; System.setProperty("jasper.reports.compile.class.path", application.getRealPath("../WEB-INF/lib/jasperreports-1.3.3.jar") + System.getProperty("path.separator") + application.getRealPath("../WEB-INF/classes/")); System.setProperty("jasper.reports.compile.temp", application.getRealPath("tmp")); JasperCompileManager.compileReportToFile(applicati on.getRealPath("shop/report/presup.jrxml")); File reportFile = new File(application.getRealPath("shop/report/presup.jasper")); Map parameters = new HashMap(); parameters.put("SQLquery", sql); byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath (), parameters, conn); ...

so? can you help me?

Last edited by Heather : 06-30-2007 at 06:07 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-30-2007, 06:01 PM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
I guess that you want to specify the gu_buys but by what ? Was it user input ?
check this, maybe it is not necessary
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-30-2007, 06:05 PM
Ed Ed is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Ed is on a distinguished road
If I were you, I'd put your query in the query section and declare parameter code (?) which you use like this:
Code:
select kc.de_buys, kc.nm_client, kc.tx_ship_notes, kc.tx_comments, kol.nm_product, kol.nu_quantity from k_buys kc inner join k_buys_lines kcl on kc.gu_buys= kcl.gu_buys inner join k_order_lines kol on kol.gu_order = kcl.gu_order where kc.gu_buys= $P{code} and in your JSP: parameters.put("some_value", code);
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-31-2007, 08:07 AM
Member
 
Join Date: Jul 2007
Posts: 1
radhakrishna_m is on a distinguished road
error in jasper reports
Hi,

i am also facing the same problem
can somebody help me out to solve this problem
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jasper report + JPQL tarat Advanced Java 2 08-01-2008 08:47 PM
org.apache.jasper.JasperException: null ranjan_ashish26 Java Servlet 1 03-21-2008 07:06 AM
Jasper iReports and Java shinky New To Java 2 08-09-2007 11:24 AM
Error loading object from file : C:\Date.jrxml Jass Report cecily Database 1 08-06-2007 05:11 AM
Jasper Report + iReport + NetBeans 4 Ed NetBeans 2 07-02-2007 09:39 PM


All times are GMT +3. The time now is 02:35 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org