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

jcowpland

Members
  • Posts

    4
  • Joined

  • Last visited

jcowpland'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. The Variable class is set to java.sql.timestamp and the same error is occurring.
  2. Thanks for the help. I changed the variable expression field to: new java.text.SimpleDateFormat("MM").Format($F{sampletime})==new java.text.SimpleDateFormat("MM").Format(new java.util.Date()) ? $F{samplevalue} : 0 but it then produces the following error. Error filling print... Error evaluating expression : Source text : new java.text.SimpleDateFormat("MM").Format($F{sampletime})==new java.text.SimpleDateFormat("MM").Format(new java.util.Date()) ? $F{samplevalue} : 0 Setting up the file resolver... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : new java.text.SimpleDateFormat("MM").Format($F{sampletime})==new java.text.SimpleDateFormat("MM").Format(new java.util.Date()) ? $F{samplevalue} : 0 at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:259) at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:580) at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:179) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:789) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1478) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:125) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:877) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find function Format in object java.text.SimpleDateFormat@9a0. at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3557) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3535) at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3563) at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3582) at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3646) at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2186) at org.mozilla.javascript.gen.c120._c0(expression:0) at org.mozilla.javascript.gen.c120.call(expression) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) at org.mozilla.javascript.gen.c120.call(expression) at org.mozilla.javascript.gen.c120.exec(expression) at net.sf.jasperreports.compilers.JavaScriptEvaluator.evaluateExpression(JavaScriptEvaluator.java:304) at net.sf.jasperreports.compilers.JavaScriptEvaluator.evaluateEstimated(JavaScriptEvaluator.java:285) at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:246) ... 13 more Print not filled. Try to use an EmptyDataSource... I'm fairly new to java and sql so it may be that I've just gotten something really simple wrong. Apolgies if that's the case.
  3. The database that I am querying has a timestamp column for each value. I would like to extract the first timestamp value as a variable to display in the report. I assumed it would be as simple as creating a variable of class java.sql.timestamp with a calculation of 'first' and a variable expression set to $F{sampletime}, but i get the following error: Error filling print... Error evaluating expression : Source text : $V{MONTH} Setting up the file resolver... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $V{MONTH} at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:195) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:589) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:557) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:929) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:383) at net.sf.jasperreports.engine.fill.JRFillTextField.resolveElement(JRFillTextField.java:775) at net.sf.jasperreports.engine.fill.JRFillElement.performDelayedEvaluation(JRFillElement.java:912) at net.sf.jasperreports.engine.fill.JRFillElement.resolveElement(JRFillElement.java:998) at net.sf.jasperreports.engine.fill.JRBaseFiller.resolveBoundElements(JRBaseFiller.java:1491) at net.sf.jasperreports.engine.fill.JRBaseFiller.resolveBoundElements(JRBaseFiller.java:1516) at net.sf.jasperreports.engine.fill.JRBaseFiller.resolveReportBoundElements(JRBaseFiller.java:1526) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1052) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:300) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:134) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:877) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: net.sf.jasperreports.engine.JRRuntimeException: org.mozilla.javascript.EvaluatorException: Cannot convert 2011-07-20 10:10:29.0 to java.lang.Number at net.sf.jasperreports.compilers.JavaScriptEvaluator.evaluateExpression(JavaScriptEvaluator.java:314) at net.sf.jasperreports.compilers.JavaScriptEvaluator.evaluate(JavaScriptEvaluator.java:278) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182) ... 21 more Caused by: org.mozilla.javascript.EvaluatorException: Cannot convert 2011-07-20 10:10:29.0 to java.lang.Number at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:922) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:978) at org.mozilla.javascript.Context.reportRuntimeError2(Context.java:948) at org.mozilla.javascript.NativeJavaObject.reportConversionError(NativeJavaObject.java:896) at org.mozilla.javascript.NativeJavaObject.coerceTypeImpl(NativeJavaObject.java:625) at org.mozilla.javascript.Context.jsToJava(Context.java:1597) at net.sf.jasperreports.compilers.JavaScriptEvaluator.evaluateExpression(JavaScriptEvaluator.java:310) ... 23 more Print not filled. Try to use an EmptyDataSource... Any help would be appreciated! =)
  4. Hi all, I am currently trying to create a report based that displays the number of pages that I am printing per month. My SQL query is pulling all the data in my database since recording of the printer page count started. Creating a variable which calculates the total is easy enough, but is there a way that a variable can select specific data from the sql query and use that in a sum calculation, i.e. just this month's data? Could I use a sql quert within the variable expression is some way? Thanks!
×
×
  • Create New...