Menu

JPivot with MDX-Query as form-method GET

Help
Dominik
2010-05-28
2013-04-29
  • Dominik

    Dominik - 2010-05-28

    Hi.

    First of all I want to thank you for JPivot and apologise for my bad english :) .

    My problem:
    I'm using Jpivot with mondrian. For my analyses I use the testpage.jsp and get the mdx-query via the form-method GET.
    Example: http://example.com/mondrian/testpage.jsp?queryString=SELECT+{.}+on+columns,+{.Children}+on+rows+from+

    This works fine until I want to edit the MDX or show a chart. Then I get:
    JPivot had an error …
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Mondrian Error:Syntax error at line 2, column 3, token 'NULL'

    The code in the testpage.jsp for setting the Mondrian-Query:

    <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" jdbcUrl="jdbc:postgresql://localhost/database" jdbcUser="user" jdbcPassword="password" catalogUri="/WEB-INF/queries/example.xml">
     <%= request.getParameter("queryString") %> </jp:mondrianQuery>
    

    Before it was:

    <wcf:include id="include01" httpParam="query" prefix="/WEB-INF/queries/" suffix=".jsp"/>
    <c:if test="${query01 == null}">
      <jsp:forward page="/index.jsp"/>
    </c:if>
    

    and examplequery.jsp:

    <%@ page session="true" contentType="text/html; charset=ISO-8859-1" %>
    <%@ taglib uri="http://www.tonbeller.com/jpivot" prefix="jp" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" jdbcUrl="jdbc:postgresql://localhost/database" jdbcUser="user" jdbcPassword="password" catalogUri="/WEB-INF/queries/example.xml">
    SELECT {[Measures].[Sales]} on columns, {[Customer].Children} on rows from [CustomerSales]</jp:mondrianQuery>
    

    The background why I am doing this way:
    I have an java program, which creates the mdx-query and uses an embedded browser.
    Maybe there is a better approach?

    I'm not very good at programming jsp so this may be just a little thing.

    Thanks for any help in advance, Japeth

     
  • Dominik

    Dominik - 2010-05-30

    Problem solved

    Because of the error I thought that the mdx-query wasn't set after I wanted to display the graph or something else.

    But the problem was that I set the query every time I wanted to do something.

    So I replaced

    <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" jdbcUrl="jdbc:postgresql://localhost/database" jdbcUser="user" jdbcPassword="password" catalogUri="/WEB-INF/queries/example.xml">  <%= request.getParameter("queryString") %> </jp:mondrianQuery>
    

    with:

    <c:if test="${query01 == null}"> 
    <jp:mondrianQuery id="query01" jdbcDriver="org.postgresql.Driver" jdbcUrl="jdbc:postgresql://localhost/database" jdbcUser="user" jdbcPassword="password" catalogUri="/WEB-INF/queries/example.xml">  <%= request.getParameter("queryString") %> </jp:mondrianQuery>
    </c:if>
    
     

Log in to post a comment.