Thread: [Jpivot-users] Hi! Help with passing parameter to mdx query by jpivot
Brought to you by:
avix
From: jasminej82 <spi...@gm...> - 2009-09-22 11:01:35
|
Hi all! I need help... I'm trying to pass parameter from url to a mdx query. I'm using this code: My first and simple cube <Schema name="ContactWheels"> <Cube name="ContactWheelsSite" cache="true" enabled="true"> <Table name="contact"> </Table> <Dimension foreignKey="site_id" name="Aziende"> <Hierarchy hasAll="true" allMemberName="Tutte le aziende" primaryKey="code" primaryKeyTable=""> <Table name="lookup_site_id"> </Table> <Level name="Nome azienda" column="description" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"> </Level> </Hierarchy> </Dimension> <Dimension foreignKey="owner" name="Owner"> <Hierarchy hasAll="true" allMemberName="Tutti gli owner" primaryKey="user_id" primaryKeyTable="access"> <Join leftAlias="role" leftKey="role_id" rightAlias="access" rightKey="role_id"> <table name="role" alias="role"></table> <table name="access" alias="access"></table> </Join> <Level name="Ruolo" column="role" table="role" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"> </Level> <Level name="Nome utente" column="username" table="access" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"> </Level> </Hierarchy> </Dimension> <Measure name="Totale utenti" aggregator="count"> <MeasureExpression> <SQL dialect="generic"> (case when contact.site_id >= 1 then 1 else null end ) </SQL> </MeasureExpression> </Measure> </Cube> </Schema> Etltools.jsp <jp:setParam query="${query01}" httpParam="param" mdxParam="parammdx"> <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" jdbcUrl="jdbc:postgresql://localhost:5432/centric_crm" jdbcUser="postgres" jdbcPassword="postgres" catalogUri="/WEB-INF/queries/contactwheels.mondrian.xml"> select ([Aziende].[Tutte le aziende]) ON COLUMNS, (Parameter("parammdx")) ON ROWS from [ContactWheelsSite] where ([Measures].[Totale utenti]) </jp:mondrianQuery> </jp:setParam> gg_crosstab1.jsp <body bgcolor="white"> <form action="gg_crosstab1.jsp" method="post"> <wcf:include id="include01" httpParam="query" prefix="/WEB-INF/queries/" suffix=".jsp"/> <c:if test="${query01 == null}"> <jsp:forward page="/index.jsp"/> </c:if> <jp:table id="table01" query="#{query01}" /> <h2><c:out value="${title01}"/></h2> <c:out value="${title2}"/> <p> <c:if test="${query01.result.overflowOccured}"> <p><strong style="color:red">Overflow</strong></p> </c:if> <wcf:render ref="table01" xslUri="/WEB-INF/jpivot/table/mdxtable.xsl" xslCache="true"/> </form> </body> </html> I call the jsp page with this url: http://localhost:8080/Pentaho/gg_crosstab1.jsp?query=etltools¶m=marketing manager The exception I get: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.tonbeller.jpivot.olap.model.OlapException: 1 What's wrong with my code? I'm newbie with mondrian and jpivot. I've just configured to use it in my webapps and I need to get this working. I have a big headache working at this from 3 days:( Thanks a lot, hope to have an answer as soon as possible. Have a great day, Veronica -- View this message in context: http://www.nabble.com/Hi%21-Help-with-passing-parameter-to-mdx-query-by-jpivot-tp25530673p25530673.html Sent from the jpivot-users mailing list archive at Nabble.com. |
From: jasminej82 <spi...@gm...> - 2009-09-27 15:16:22
|
jasminej82 wrote: > > Hi all! > I need help... I'm trying to pass parameter from url to a mdx query. > I'm using this code: > > My first and simple cube > <Schema name="ContactWheels"> > <Cube name="ContactWheelsSite" cache="true" enabled="true"> > <Table name="contact"> > </Table> > <Dimension foreignKey="site_id" name="Aziende"> > <Hierarchy hasAll="true" allMemberName="Tutte le aziende" > primaryKey="code" primaryKeyTable=""> > <Table name="lookup_site_id"> > </Table> > <Level name="Nome azienda" column="description" type="String" > uniqueMembers="false" levelType="Regular" hideMemberIf="Never"> > </Level> > </Hierarchy> > </Dimension> > > <Dimension foreignKey="owner" name="Owner"> > <Hierarchy hasAll="true" allMemberName="Tutti gli owner" > primaryKey="user_id" primaryKeyTable="access"> > <Join leftAlias="role" leftKey="role_id" rightAlias="access" > rightKey="role_id"> > <table name="role" alias="role"></table> > <table name="access" alias="access"></table> > </Join> > <Level name="Ruolo" column="role" table="role" type="String" > uniqueMembers="false" levelType="Regular" hideMemberIf="Never"> > </Level> > <Level name="Nome utente" column="username" table="access" > type="String" uniqueMembers="false" levelType="Regular" > hideMemberIf="Never"> > </Level> > </Hierarchy> > </Dimension> > > <Measure name="Totale utenti" aggregator="count"> > <MeasureExpression> > <SQL dialect="generic"> > (case when contact.site_id >= 1 then 1 else null end ) > </SQL> > </MeasureExpression> > </Measure> > > </Cube> > </Schema> > > Etltools.jsp > <jp:setParam query="${query01}" httpParam="param" mdxParam="parammdx"> > <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" > jdbcUrl="jdbc:postgresql://localhost:5432/centric_crm" jdbcUser="postgres" > jdbcPassword="postgres" > catalogUri="/WEB-INF/queries/contactwheels.mondrian.xml"> > select ([Aziende].[Tutte le aziende]) ON COLUMNS, (Parameter("parammdx")) > ON ROWS from [ContactWheelsSite] where ([Measures].[Totale utenti]) > </jp:mondrianQuery> > </jp:setParam> > > gg_crosstab1.jsp > <body bgcolor="white"> > <form action="gg_crosstab1.jsp" method="post"> > <wcf:include id="include01" httpParam="query" prefix="/WEB-INF/queries/" > suffix=".jsp"/> > <c:if test="${query01 == null}"> > <jsp:forward page="/index.jsp"/> > </c:if> > > <jp:table id="table01" query="#{query01}" /> > <h2><c:out value="${title01}"/></h2> > <c:out value="${title2}"/> > <p> > <c:if test="${query01.result.overflowOccured}"> > <p><strong style="color:red">Overflow</strong></p> > </c:if> > <wcf:render ref="table01" xslUri="/WEB-INF/jpivot/table/mdxtable.xsl" > xslCache="true"/> > </form> > </body> > </html> > > I call the jsp page with this url: > http://localhost:8080/Pentaho/gg_crosstab1.jsp?query=etltools¶m=marketing > manager > > The exception I get: > javax.servlet.ServletException: javax.servlet.jsp.JspException: > com.tonbeller.jpivot.olap.model.OlapException: 1 > > > What's wrong with my code? I'm newbie with mondrian and jpivot. > I've just configured to use it in my webapps and I need to get this > working. I have a big headache working at this from 3 days:( > Thanks a lot, hope to have an answer as soon as possible. > Have a great day, > > Veronica > Nobody can help me? -- View this message in context: http://www.nabble.com/Hi%21-Help-with-passing-parameter-to-mdx-query-by-jpivot-tp25530673p25634462.html Sent from the jpivot-users mailing list archive at Nabble.com. |