I've been asked to develop a report using Jaspersoft studio to generate the report template and then use jaspersoft server to have users that generate the report on demand, using data from a CSV file, instead of a DB.
I've been able to generate a report locally using studio, upload the report to the server, but I'm not able to generate the report from there.
I've been looking around and every solution that is proposed is to inject the data into a DB and then generate the report using that. But in other post in the jaspersoft community, it's said that CSV support is going to be added by early 2014, so I guess it's already there.
So, What I think that might fix it is:
1) Add the CSV file to the server, but how to link the report (.jrxml) and the dataAdapter (.xml)?
Right now, I've uploaded it to /contentFiles/xls/energy.csv, but if I put that on the data adaptor, jaspersoft can't find it:
I assume because there is no ip to the server, so it might think it's a local file. If I use the ip to the server, in my case, http://...***:8080/jasperserver/ (* for security reasons) and add after that /contentfiles/xls/energy.csv it still can find it. So, how to link the adaptor to the csv file on the server?
Also, since this csv file will be generated from time to time:
2) There is a folder where I can place or generate the csv file to be updated on the jaspersoft server?
There are a couple of steps to follow in order to have a file-based
dataAdapter
correctly deployed in JasperReports Server. The following steps were performed with Jaspersoft Studio 6.4.0 and JasperReports Server Pro 6.4.0.(I'm using the CsvDataSouce.txt from the csvdatasource sample)
you begin by creating the data adapter from the Repository Explorer view by pointing to your file and setting up the column names.
You then export your newly created adapter to file by right-clicking it and choosing the Export To File option (I'm saving it along the CSV file)
At this point you could even delete the adapter from the Repository Explorer view and keep only the saved file to avoid any mistakes. You then create your report by picking the workspace dataAdapter and continue with your report design.
Publishing the report to the server at this stage would not push the dataAdapter files. You need to specify the report's Default Data Adapter property from the properties panel
by picking your workspace adapter
Make sure you pick the Don't use any Data Source option in the last dialog
Your report is now linked to the one from the server with this set of properties:
You can continue to work on it and Jaspersoft Studio will prompt you to republish on each save.