wangmin2001 Posted October 19, 2014 Share Posted October 19, 2014 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 ExecutionCompiling report......DONESetting Data Adapter...DONESetting Virtualizer...DONEFilling Report........DONEReport Execution Finished. any help is appreciated! Link to comment Share on other sites More sharing options...
eferrell Posted October 21, 2014 Share Posted October 21, 2014 "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 DUALPostgreSQL: select 1 as field1MySQL: select 1 Link to comment Share on other sites More sharing options...
wangmin2001 Posted October 22, 2014 Author Share Posted October 22, 2014 eferrell, thank you very much.I add a simple query for main report ,and it works!I think it's a not good feature since sometimes we do not need a query.aanyway ,thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now