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

pssp25

Members
  • Posts

    28
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by pssp25

  1. Hi Remco,

    I think that is not possible because event if you are able to hack with some sort of search function.
    You still have the possibility to have 2 reports with same name in different folders.

    Plus you may have the folder permission that may ruin the access to some users.

    Hope this helps.

    Kind regards,
    Paulo

     

     

     

     

     

     

     

     

  2. Hi Masteryoda,

     

    Here is a javascript function (needs jquery)

     

    function login() {

        $.get("http://localhost:8080/jasperserver-pro/rest/login?j_username=jasperadmin&j_password=jasperadmin", function() {

            alert("Logged in! Do stuff here!")

        }).fail(function() {

            alert("Cannot login!")

        });

    }

     

    Let me know if it works.

     

    Kind regards,

    Paulo

  3. The only options that I see left:

    - Reduce item label font size (reduces readability)

    - Have you tried the HTML5 Charts (Pie) - This chart labels are smarter than the normal Chart.

     

    Left me know if this helps you.

     

    Kind regards,

    Paulo

     

     

     

  4. Hi Michele,

    You don't need to have different DIM_TIME tables.
    The DIM_TIME dimension is only one. The fact table can have several foreign keys (TIME_DEPARTURE and TIME_ARRIVAL) to the same dimension (DIM_TIME).

    When defining the cube in Mondrian you define a time dimension and then you can have several virtual dimensions (arrivals and departures) that will 'reuse' this dimension.

     

    Let me know if it helps,

     

    Kind regards,

    Paulo 

     

     

     

     

     

     

     

  5. Hi Manpreet,

    For OLAP you need

    • the connection "MySQL, MSSQL or whatever your DB
      the schema.xml file with the cube definition of you OLAP cubes.
      Connection connection = DriverManager.getConnection("Provider=mondrian;Jdbc=jdbc:mysql://localhost/databasename?user=root;password=;Catalog=file:c:/temp/schema.xml;JdbcDrivers=com.mysql.jdbc.Driver;" , null);
    • Need to use MDX queries 
    • Create a JSON from the mondrian result.

    Let me know if this helps you?

    Kind regards,
    Paulo

  6. Hi materyoda,

    It seems that the test should login first.
    The 403 Forbidden  message that your getting means that no authentication has been performed.

    Can walso mean that credentials from tests are wrong.

    Please check if all that credentials match.

    kind regards,

    Paulo

     

  7. In the folder jaspersoft-proWEBINFjspmodulesolap I changed the file viewOlap.jsp to the following.

     

     

    <%@ page language="java" contentType="application/json;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>

     

    <%@ page import="com.google.gson.Gson" %>

    <%@ page import="mondrian.olap.*" %>

     

    <%@ page import="java.util.List" %>

    <%@ page import="java.io.PrintWriter" %>

     

    <%!

    public static String ResultToJson(Result result) {

    StringBuffer sbResult = new StringBuffer();

    int axis1length = 0;

    int axis2length = 0;

    Gson gson = new Gson();

    sbResult.append("{ "axis" : { "); // =============================== Axis

    for(int i =0; i< result.getAxes().length; i++ ) {

     

    List listPosition = result.getAxes().getPositions();

    sbResult.append(" "axis" + i +"" : [");

     

    for (int p =0; p < listPosition.size(); p++ ) {

    sbResult.append("");

    for (int m = 0; m < listPosition.get(p).size(); m++) {

    Member member = listPosition.get(p).get(m);

    sbResult.append(" { "un" :");

    sbResult.append(gson.toJson(member.getUniqueName()));

    sbResult.append(", "n" : ");

    sbResult.append(gson.toJson(member.getName()));

    sbResult.append(", "c" : ");

    sbResult.append(gson.toJson(member.getCaption()));

    sbResult.append(", "pun" : ");

    sbResult.append(gson.toJson(member.getParentUniqueName()));

    sbResult.append(" },");

    // sbResult.append("n");

    }

    sbResult.append(",");

    }

    sbResult.append("],");

    }

    sbResult.append("} ");

    sbResult.append(", "values" : ");

     

    axis1length = result.getAxes()[0].getPositions().size();

    axis2length = result.getAxes()[1].getPositions().size();

     

    sbResult.append("["); // =============================== Values

    for (int i = 0; i < axis2length; i++ ) {

    sbResult.append("[");

    for (int j=0; j< axis1length; j++) {

    int[] cellindex = new int[] {j,i};

    Cell cell = result.getCell(cellindex);

    sbResult.append(gson.toJson(cell.getValue()));

    sbResult.append(",");

    }

    sbResult.append("],");

    }

    sbResult.append("]");

    sbResult.append("}"); // Global

    String res = sbResult.toString();

    res = res.replace("[]","").replace(",,",",").replace(",]","]").replace(",}","}").replace(""""," ");

    return res;

    }

    %>

     

    <%

    try {

    String mdx = request.getParameter("mdx");

    if (mdx == null) {

    if (mdx.equals("")) {

    out.print("{"error":"empty mdx query"}");

    return;

    }

    }

    Connection connection = DriverManager.getConnection("Provider=mondrian;Jdbc=jdbc:mysql://localhost/reportvisiondm?user=root;password=;Catalog=file:c:/temp/ReportVisionDMSchema.xml;JdbcDrivers=com.mysql.jdbc.Driver;" , null);

    Query query = connection.parseQuery("WITH SET [selectedMeasures] AS '{[Measures].[WorkItemsCount]}' SELECT NON EMPTY CrossJoin([selectedMeasures], [Department].[Department].Members) ON COLUMNS, NON EMPTY {Hierarchize({[CreatedDate.YMD].[Year].Members, Descendants([CreatedDate.YMD].[2012], [CreatedDate.YMD].[Month]), Descendants([CreatedDate.YMD].[2013], [CreatedDate.YMD].[Month]), Descendants([CreatedDate.YMD].[2011], [CreatedDate.YMD].[Month])})} ON ROWS FROM [WorkPermits]");

    Result result = connection.execute(query);

    out.print(ResultToJson(result));

    return;

    } catch (Exception ex) {

    out.print(ex.getMessage());

    out.print("
    ");

    }

    %>

     

    Then you can query with:

    http://localhost:8080/jasperserver-pro/olap/viewOlap.html?new=true&parentFlow=searchFlow&name=%2Fpublic%2FSamples%2FOLAP%2FViews%2FOLAP_View_Report1&ParentFolderUri=%2Fpublic%2FSamples%2FOLAP%2FViews&viewAsDashboardFrame=true

     

    On the JSP file you can configure the datasource and the schema file.

    You can pass a MDX query via parameter and you will have your result in JSON.

    Let me know if it helps.

  8. Hi all,

    Currently I have a Cube and I can via Adhoc view throw queries and have results in tables or charts.

    My question is:

    What is the simplest way of thowing this MDX queries and having the result in JSON.

    Kind regards,

    Paulo

     

×
×
  • Create New...