rajivranjanmaurya Posted December 8, 2015 Share Posted December 8, 2015 Hi,I want to create a parameter of type drop down using jaspersoft studio 6.2.0 (I am not using JasperServer) and populate data in this drop down from a JSON file. Based on the value selected in drop down paramter my report will be displayed.Example: I have a JSON file which has data related to students. Suppose there is details of 100 students. Now I want to create a drop down parameter which will be populated with student name from the JSON file and on selecting any student from the drop down, details of that student should be generated.sample JSON:[{"ID": 1,"Name": "Arun","Phone": 123564,"Branch": "ECE"}, {"ID": 2,"Name": "Praveen","Phone": 147852,"Branch": "CSE"}, {"ID": 3,"Name": "Amla","Phone": 15987456,"Branch": "EEE"}] Please help me in creating drop down parameter. Thanks,Rajiv Link to comment Share on other sites More sharing options...
zuhayer171288 Posted December 8, 2015 Share Posted December 8, 2015 I am having the same issue, but my data is coming from db table instead of json.Check if this might give u a hint: http://stackoverflow.com/questions/33819990/get-list-of-values-lov-from-sql-query-in-jasperreport/33828226#33828226 Link to comment Share on other sites More sharing options...
marianol Posted December 8, 2015 Share Posted December 8, 2015 Since you are not using Jasperserver is up to you to create your select box from the JSON file, there are tons of Javascript UI libraries that will enable to do that.JasperReports just needs the parameter to be passed it does not have any influence on how you handle the display of that to your user.For more infor on using parameters look into: http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v62/using-parameters Link to comment Share on other sites More sharing options...
hozawa Posted December 9, 2015 Share Posted December 9, 2015 If you want to have a drop down list in Jaspersoft Studio, just create a parameter with datatype java.util.List.If you set the report language to Groovy, you'll be able to set something like ["First", "Second"]. You'll need to convert your JSON to List. 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