Jump to content
Changes to the Jaspersoft community edition download ×

Creating a chart from a MongoDB document List


Recommended Posts

I have MongoDB repository with some fairly complex documents. The gist of the doc is that it has lists of number that I want to create a chart from. For example:








I'd like to chart the x list vs the y list. We're using the AWS variant of the reporting tool and it doesn't support creating topics directly so I'm using iReportDesigner and writing the query with the fields I want back  (x, y) in this example. I then upload the document to AWS Jaspersoft and use that as the topic. When I go to create the chart on the web frontend I get this error below. I have a double whammy n00b scenario as I am newish to both Mongo and Jasper and I'd appreciate any pointers.



The server has encountered an error. Please excuse the inconvenience.

Error Message

java.lang.IllegalArgumentException: unsupported column type java.util.List

Error Trace

java.lang.IllegalArgumentException: unsupported column type java.util.List at com.jaspersoft.commons.datarator.DataColumnFactory.createRawColumn(DataColumnFactory.java:122) at com.jaspersoft.commons.datarator.CategorizedColumn.<init>(CategorizedColumn.java:39) at com.jaspersoft.commons.datarator.SelfOptimizingColumn.<init>(SelfOptimizingColumn.java:25) at com.jaspersoft.commons.datarator.DataColumnFactory.create(DataColumnFactory.java:116) at com.jaspersoft.commons.datarator.ColumnDataSet.addColumnInfo(ColumnDataSet.java:41) at com.jaspersoft.commons.datarator.AbstractDataSet.setColumnInfoList(AbstractDataSet.java:148) at com.jaspersoft.commons.datarator.CachedData.<init>(CachedData.java:73) at com.jaspersoft.commons.datarator.BaseDataSetCacheImpl.getCachedDataSet(BaseDataSetCacheImpl.java:102) at com.jaspersoft.commons.datarator.BaseDataSetCacheImpl.getWorkingDataSet(BaseDataSetCacheImpl.java:136) at com.jaspersoft.commons.semantic.dsimpl.memory.MemoryDataSet.getWorkingDataSet(MemoryDataSet.java:97) at com.jaspersoft.ji.adhoc.strategy.NewClassicDataStrategy.getWorkingDataSet(NewClassicDataStrategy.java:120) at com.jaspersoft.ji.adhoc.strategy.CommonDomainDataStrategy.getWorkingDataSet(CommonDomainDataStrategy.java:1026) at com.jaspersoft.ji.adhoc.InteractiveDataLayoutEngine.initWorkingDataSet(InteractiveDataLayoutEngine.java:350) at com.jaspersoft.ji.adhoc.InteractiveCrosstabBaseEngine$DimensionDataSetInitializer.initDimensionDataSet(InteractiveCrosstabBaseEngine.java:101) at com.jaspersoft.ji.adhoc.InteractiveCrosstabBaseEngine$DimensionDataSetInitializer.init(InteractiveCrosstabBaseEngine.java:81) at com.jaspersoft.ji.adhoc.InteractiveIntelligentChartEngine.generateViewModel(InteractiveIntelligentChartEngine.java:113) at com.jaspersoft.ji.adhoc.action.AdhocAction.setReportModelInContext(AdhocAction.java:1495) at com.jaspersoft.ji.adhoc.action.AdhocAction.view(AdhocAction.java:593) at com.jaspersoft.ji.adhoc.action.AdhocAction.initForTopic(AdhocAction.java:454) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 

.....+ Much more of course




Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 months later...
Hi, I am having converting string to date and integer. In mongodb both date and numbers stored as string. During chart creation, I put date string as X axis and number string as y axis. But ireport is complaining that it can't convert string to date. Anyone know how to convert date string to java.util.Date so that chart can display date as x-axis. Similary how to convert string to integer so taht chart can display y axis with integer value.
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...