Jump to content
We've recently updated our Privacy Statement, available here ×

cnesbit

Members
  • Posts

    6
  • Joined

  • Last visited

cnesbit's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I used to be able to do this but came back to some of my reports recently and they no longer work. For this example query: SELECT 'bob' AS StudentName if I put that query in the "Report query" popup directly, it works. If I put any part of that query, or the whole query, it dies complaining about SQL syntax. Only way for a parameter to work at the moment is if I use this query: SELECT $P{report_query} AS StudentName What I need is for the parameter to contain the whole query ( $P{report_query} = SELECT 'bob' AS StudentName) but when I do that I get this error: Error:SQL problems:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "SELECT 'bob' AS StudentName" at line 1 It appears that ireport is trying to be "smart" and insert some extra quotes for me that I don't want. can I prevent this behaviour or work around it somehow? HOW CAN I USE A PARAMETER FOR THE ENTIRE QUERY WITHIN IREPORT? -cnesbit EDIT: I figured out the solution myself. It's not well documented, I happened across it by accident about halfway down this link The solution is to format your parameter with a ! character like so: $P!{my_query} (rather than $P{my_query} ). Post Edited by cnesbit at 01/12/2012 21:59
  2. In iReport there are JasperReports Properties, in the Tools > Options popup. Many of these are useful such as the defaults like net.sf.jasperreports.default.font.size and net.sf.jasperreports.default.font.name. One annoyance of creating alot of reports is the default size of the textbox and label. They're too big for my reports and I'm always having to resize them, often to the same size. Are there any default properties I can modify or add that will effect the default height of some/all report elements? If there isn't could that be added in one of the next revisions? Thanks, cnesbit
  3. [FIXED]: I'm not sure what code went "missing", but apparently there was something lying around in my war file that shouldn't've been (or was missing, and shoulda been there). When I added the "clean" step to the beginning of my ant build script, my reports magically started working again. Now, after effectively wasting 2 days, I know why I don't make a habit of programming in Java. It's so picky, it's not enough to write flawless code and have a flawless build script, you also have to "start over" everytime you recompile.
  4. dtiwan Wrote: Sorry dude, but it looks like a application specific issue. You said "all of a sudden", does that mean it use to work? If yes, what changed? Looks like you have missing code in your application or older jar or class sitting in web-app. I would compare it against a version control. yes, it used to work. Changes are mainly related to adding additional *.jar files to my project, which I needed for some of the code I was adding. You say, it looks like an application specific issue, and I was thinking the same thing. I guess my question is this: When you're adding a scriptlet to a report and it works in ireport, on the commandline, but not in the web-app what sort of specific things do I need to look for to fix this inconsistancy? I've been at this for a few days now, and maybe I'm just overlooking something unknowingly. This project is one of my first, in the area of Java and web-apps. So keep that in mind when you're about to leave out "something obvious". :) Thanks! cnesbit Post Edited by cnesbit at 08/02/2011 17:16 Post Edited by cnesbit at 08/02/2011 17:16
  5. I've got a report that uses a scriptlet I wrote to run several functions. non of them seem to work all of a sudden. here's an example of one I call from the report, it takes a string in 1 date format and returns the same date in a different format. Error evaluating expression $P{REPORT_SCRIPTLET}.format_date( $F{lunchdate} ) It does work, in ireport, and it does work from the command line when I call it like a normal class file. But it does not work when I deploy it in a *.war file. here's the line in my webapp's code that it "dies" on, though this has never broken before: JasperRunManager.runReportToPdfFile(reportFile.getPath(), rptOutputName, parameters, conn); here's the actual stacktrace: SEVERE: Servlet.service() for servlet pdf threw exception net.sf.jasperreports.engine.JRRuntimeException: Error loading report v2/lunch_orders_monthly. Please contact your school administrator if this error persists. ERROR: Error evaluating expression : Source text : $P{REPORT_SCRIPTLET}.format_date( $F{lunchdate} ) at servlets.pdf.service(pdf.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679) Any help would be appreciated. This problem could prevent me from meeting a deadline for a customer at the end of the week. -cnesbit
×
×
  • Create New...