Jump to content
We've recently updated our Privacy Statement, available here ×

Uploading a CSV to use as input for a report


glen

Recommended Posts

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) and

2. 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 which

1. allows the user to browse their local directory and select the right csv file

2. then read the contents of that file and use it as an input list into the main report

Hopefully 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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...