iReport with Mondrian OLAP connection

hello:

i have a report with mondrian connection, this connection is well built (i have made the test and it returns "connection test succesfully")

when i run the report, ireport shows the next error:

ErrorÂfillingÂprint...
OpeningÂMondrianÂconnection ClosingÂMondrianÂconnection net.sf.jasperreports.engine.JRRuntimeException:ÂIncorrectÂdataÂmapping:ÂtheÂnumberÂofÂpositionsÂdoesn'tÂmatchÂtheÂnumberÂofÂaxes. ÂÂÂÂatÂnet.sf.jasperreports.olap.JRMondrianDataSource$DataFieldMatcher.<init>(JRMondrianDataSource.java:477) ÂÂÂÂatÂnet.sf.jasperreports.olap.JRMondrianDataSource.createFieldMatcher(JRMondrianDataSource.java:287) ÂÂÂÂatÂnet.sf.jasperreports.olap.JRMondrianDataSource.init(JRMondrianDataSource.java:255) ÂÂÂÂatÂnet.sf.jasperreports.olap.JRMondrianDataSource.<init>(JRMondrianDataSource.java:115) ÂÂÂÂatÂnet.sf.jasperreports.olap.JRMondrianQueryExecuter.createDatasource(JRMondrianQueryExecuter.java:84) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:662) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillDataset.setDatasource(JRFillDataset.java:606) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:595) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:879) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:708) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:420) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:256) ÂÂÂÂatÂit.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:829) ÂÂÂÂatÂjava.lang.Thread.run(UnknownÂSource)


can anybody help me, please???
sergiomaky's picture
Joined: Sep 21 2006 - 6:20pm
Last seen: 16 years 8 months ago

5 Answers:

This error is caused by field mappings inconsistent with the MDX query: a data/cell mapping specifies axis positions but the number of positions doesn't match the number of axes of the query result cube.

HTH,
Lucian
lucianc's picture
76730
Joined: Jul 17 2006 - 1:10am
Last seen: 6 min 15 sec ago
Hi Lucianc,

If i have the mdx:

select {[Measures].[Unit Sales]} on columns,
{([Product].[All Products] ) } on rows
from Sales

How should be the expression of the field?

Thanks in advance.
vgarcia's picture
-2
Joined: Sep 21 2006 - 7:51pm
Last seen: 16 years 8 months ago
You can use the following mapping for a data field:
Data([Measures].[Unit Sales],?)

Or, since you have only one measure on the column axis, you can also simply use Data as the field mapping.

HTH,
Lucian
lucianc's picture
76730
Joined: Jul 17 2006 - 1:10am
Last seen: 6 min 15 sec ago
Thanks Lucian.

I have one more question. If i have the previous mdx:

select {[Measures].[Unit Sales]} on columns,

{([Product].[All Products] ) } on rows

from Sales


I want to show all data, and the values of the dimensions, etc. I want to say that i want to show all data that we would see in the cube.

What fields i need to create?
vgarcia's picture
-2
Joined: Sep 21 2006 - 7:51pm
Last seen: 16 years 8 months ago
You can't use this query to display "all the data in the cube", since the query result cube consists of a single element. You would need a query like
Code:
select {[Measures].[Unit Sales]} on columns,<br />
[Product].members on rows<br />
from Sales</td></tr></tbody></table><br />
<br />
Using this query, you can map fields to dimension values, e.g. <i>Rows[Product][Product Category]</i>.<br />
<br />
You can check the "mondrian" sample in the JasperReports distribution, it contains a couple of MDX reports.<br />
<br />
HTH,<br />
Lucian
lucianc's picture
76730
Joined: Jul 17 2006 - 1:10am
Last seen: 6 min 15 sec ago
Feedback