glen Posted April 2, 2009 Share Posted April 2, 2009 I have built a report that uses a csv with a list of customer numbers as input. The report reads the csv into the main report and then retrieves customer details from a database and prints them in a subreport. All fine if I run this in iReport.The challenge I have is :1. the report needs to run from the JasperServer (3.5) and2. the csv is a file that will be on the users local machine (exact filename and directory will vary each time)So the idea is for the report on the JasperServer to have an input control which1. allows the user to browse their local directory and select the right csv file2. then read the contents of that file and use it as an input list into the main reportHopefully that use case is clear. I have spent a few days hunting through samples of custom input controls and datasources but I cannot find a suitable solution.Suggestions / Solutions much appreciated. Link to comment Share on other sites More sharing options...
mangeshgopale Posted April 3, 2009 Share Posted April 3, 2009 You can use the Custom Datasource to handle CSV files as a datasource.Please check the JasperReports documentation to know how to implement our own datasources and plug them in. Link to comment Share on other sites More sharing options...
glen Posted April 3, 2009 Author Share Posted April 3, 2009 There is already a CSV datasource so I don't need to write one for that. The trick is a custom datasource I think that allows a user to access local resources at runtime. Which I think will involve finding some jsp that provides a file browse control and adding that into DefaultParametersForm.jsp. Also not so simple because I cannot just pass the filename as a paramater to the report because the server will not be able to access that file. The input control has to upload the file into memeory and use it while running the main report. 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