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

Strange Behaviour - CSV Datasource


arbitary

Recommended Posts

I am creating a report with a csv datasource(its a tab-delimited file actually). It has 4 columns, which I specify in my report definition as COLUMN_1 to COLUMN_4.

 

In the Java code, when I call the 'fillReport' method, I get the following error -

 

17:57:27,144 INFO [sTDOUT] net.sf.jasperreports.engine.JRException: Unknown col

umn name : COLUMN_4

 

This happens only when the tab delimited file does not have data in the 4th column.

 

This is very strange, since I have data missing in columns 2 and 3 too, but it works OK.

 

Has anyone ever come across this? Any solutions will be appreciated.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I think I found a bug here. In JRCsvDataSource, in the function parseRow(), for the last column, if there is no data, it is not added to the Vector of fields.

 

So, if the last column is blank or null, the program thinks that there are (actual-1) columns.

 

I removed this check and it works fine.

Link to comment
Share on other sites

  • 2 weeks later...

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