whong Posted July 25, 2017 Share Posted July 25, 2017 I got null value report by running jsondatasource sample in Jaspersoft Studio. However, I can get pdf report by using the same template in Java. Any ideas?Thank you, Link to comment Share on other sites More sharing options...
vchiem Posted July 26, 2017 Share Posted July 26, 2017 This is what I found. The data adapter is showing up as "One Empty Record" for the Json sample report to show null. Try picking "Sample DB" as the data adapter in the Preview tab before previewing. It seems Studio requires a data adapter connection despite the source of data is from JSON data file. This data connection is linked to the report template, JsonCustomerReport, which has a "com.jaspersoft.studio.data.defaultdataadapter" property. Or you can create a new JSON Data Adapter in Studio Repository explorer and point this to ..JasperReportsSamplesjsondatasourcedatanorthwind.json and select "Use the report JSON expresson when filling the report".Note: you may (or may not) encounter an error with the OrderDate whilst previewing. If so, try changing the OrderDate type from java.util.Date to java.sql.Date in the Dataset and Query Dialog of the JsonOrderReport subreport and save and recompile to regenerate the .jasper. Link to comment Share on other sites More sharing options...
Solution whong Posted July 26, 2017 Author Solution Share Posted July 26, 2017 I found jsondatasource requests both below properities in the .jrxml to generate report in Jaspersoft Studio. <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>[/code][/code]<property name="net.sf.jasperreports.json.source" value="northwind.json"/>[/code]Thank you, 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