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

noob question


wingfield65

Recommended Posts

new user here.  downloaded jaspersoft studio 6.20.6.  created new project.  created new report.  tried to start with excel data adapter.  got below error.  appreciate any thoughts on how to get this to work.

 

class net.sf.jasperreports.fastexcel.FastExcelDataSource cannot be cast to class net.sf.jasperreports.engine.data.ExcelDataSource (net.sf.jasperreports.fastexcel.FastExcelDataSource and net.sf.jasperreports.engine.data.ExcelDataSource are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @5d026573)

 

Link to comment
Share on other sites

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

Hello, I'm facing similar problem using the same version of Jaspersoft Studio. I believe what I did was similar to what @wingfield65 did, but just in case it is not, here is what I did. 

In the New Report Wizard's Data Source section I created new data adapter. In the Data Adapter Wizard which popped-up afterward, I selected Microsoft Excel and then I selected the file. Everything worked fine in this wizard, I could see the column names of my source file. However after returning to New Report Wizard and click Next, an error dialog popped. 

At first, I had a column containing image in its cells which I thought was the cause. However, even after removing the image, it still failed. If it really is a bug, I hope it can be addressed soon.

Thank you

Link to comment
Share on other sites

Hi, the problem you are verifying it's actually a bug in the latest version 6.20.6 where the new FastExcel library was added, besides the "standard" POI. A fix will be available in the next release.

Since the exception is triggered during the "read fields" operation, you might need to create the initial report using another DA, for example the "empty" one. Later add manually the fields in the report with the same names of the columns you added manually or automatically read in the Excel data adapter.

This workaround should allow you to use the XLS DA to run the report preview.

Best regards,
Massimo.

Link to comment
Share on other sites

Hi, another more clean solution is to force the following JR property in the Jaspersoft Studio preferences. This will allow you to use the old POI data source and be able to create the report as usual without triggering the exception.

net.sf.jasperreports.xlsx.data.source.factory = net.sf.jasperreports.engine.data.ExcelDataSourceFactory

See the attached image as well.

Best regards,
Massimo.

configuringOldExcelDatasource.png

  • Thanks 1
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...