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

Urgent:run scriptlet to return - document is empty


wangmin2001

Recommended Posts

HI,  I am using scriptlet in jasper studio, I do following steps:

1. copy demo scriptlet java code to netbean project to build  a jar file.

2. add jar file to jasper studio  java build path (add external jar to studio project java build path)

3. create a new simple report with static text and text fileds.

3. add script class for report properties,

4. define $P{report_scriptlet}  properities with script class.

then I copy demo code-  set text filed expression -->    $P{report_scriptlet}.hello()

then I run it in studio , it return me "document is empty!"  what that mean?

I am sure now studio can found my scriptlet, since compile is fine , and console return message :

Start Report Execution
Compiling report......DONE
Setting Data Adapter...DONE
Setting Virtualizer...DONE
Filling Report........DONE
Report Execution Finished.

 

any help is appreciated!

 

 

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

"Document is Empty" means that your main data set query did not return any records. If you're not using the main data set query (perhaps you're retrieving your data from sub-data sets or the scriptlet itself) then you need to put in a static query to return at least one result. Here are some examples:

Oracle: select 1 from DUAL

PostgreSQL: select 1 as field1

MySQL: select 1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...