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

rickn

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by rickn

  1. I created a report that uses the scriptlet listed below. The report runs in iReport but not when I deploy it to the JasperServer on the same machine. The report scriptlet property is set to "com.gbi.MyScriptlet" and the JAR file was added as a resource to the report. I tried using the JAR resource from the repository and as an uploaded local file but the results were the same. When I open a report with input controls, i just get a blank page. If there are no input controls, the "Please wait Loading..." box comes up but never goes away. I'm new to Jaspersoft and Java so any help will be greatly appreciated. Code:package com.gbi;import net.sf.jasperreports.engine.JRDefaultScriptlet;import net.sf.jasperreports.engine.JRScriptletException;import java.util.*;public class MyScriptlet extends JRDefaultScriptlet{ long pageInitTime; @Override public void beforePageInit() throws JRScriptletException { pageInitTime = new java.util.Date().getTime(); } public long getLastPageTime() { long now = new java.util.Date().getTime(); return new Long(now - pageInitTime); } public String ArrayToString(Collection coll) { // create comma-delimited string from collection StringBuilder str = new StringBuilder(""); Iterator it = coll.iterator(); while (it.hasNext()) { str.append(it.next()); str.append(","); } return (str.substring(0,str.length()-1)); }}
×
×
  • Create New...